From 7da8ef908e09ae0738f26838656abcb3f4c8d2ad Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Mon, 17 Jul 2006 20:35:22 +0000 Subject: [PATCH] force 'base href=...../~x......' once for good. make {rel} return '.' and see that it works \o/ git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@537 839d8a87-29fc-0310-9880-83ba4fa771e5 --- hooks/tmp.inc.php | 2 +- htdocs/admin/homonymes.php | 1 - include/banana.inc.php | 19 +++++++------------ include/notifs.inc.php | 10 +++++----- include/platal/page.inc.php | 2 +- include/wiki.inc.php | 2 +- include/xorg/menu.inc.php | 12 ++---------- modules/profile.php | 2 +- plugins/function.rel.php | 9 +-------- plugins/pmwiki.config.php | 4 ++-- plugins/pmwiki.platalSkin.php | 3 +-- templates/admin/homonymes.tpl | 6 +++--- templates/skin/common.devel.tpl | 2 +- templates/skin/default.tpl | 1 + templates/skin/espace.tpl | 1 + templates/skin/humlinux.tpl | 1 + templates/skin/linux.tpl | 1 + templates/skin/liteskin.tpl | 1 + templates/skin/nbviolet.tpl | 1 + templates/skin/newxorg.tpl | 1 + templates/skin/oldtimes.tpl | 1 + templates/skin/openweb.tpl | 1 + templates/skin/sharky.tpl | 1 + templates/skin/spectral.tpl | 1 + templates/skin/trapped.tpl | 1 + templates/xnet/skin.tpl | 3 ++- 26 files changed, 40 insertions(+), 49 deletions(-) diff --git a/hooks/tmp.inc.php b/hooks/tmp.inc.php index 491e97b..808bd36 100644 --- a/hooks/tmp.inc.php +++ b/hooks/tmp.inc.php @@ -30,7 +30,7 @@ function tmp_menu() $globals->menu->addPrivateEntry(XOM_CUSTOM, 50, 'Mes préférences', 'prefs'); $globals->menu->addPrivateEntry(XOM_GROUPS, 10, 'Trombi promo', 'trombi'); - $globals->menu->addPrivateEntry(XOM_GROUPS, 20, 'Conseil Pro.', 'referent'); + $globals->menu->addPrivateEntry(XOM_GROUPS, 20, 'Conseil Pro.', 'referent/search'); if ($globals->geoloc->use_map()) $globals->menu->addPrivateEntry(XOM_GROUPS, 10, 'Planisphère', 'geoloc/'); $globals->menu->addPrivateEntry(XOM_GROUPS, 30, 'Groupes X', 'http://www.polytechnique.net/plan'); diff --git a/htdocs/admin/homonymes.php b/htdocs/admin/homonymes.php index ff2d3f0..455546e 100644 --- a/htdocs/admin/homonymes.php +++ b/htdocs/admin/homonymes.php @@ -40,7 +40,6 @@ if ($target) { $page->assign('op',$op); $page->assign('target',$target); -$page->assign('baseurl',$globals->baseurl); // on a un $target valide, on prepare les mails if ($target) { diff --git a/include/banana.inc.php b/include/banana.inc.php index 0529996..19dff94 100644 --- a/include/banana.inc.php +++ b/include/banana.inc.php @@ -22,14 +22,12 @@ require_once('banana/banana.inc.php'); function hook_formatDisplayHeader($_header, $_text) { - global $globals, $banana; + global $banana; if ($_header == 'from') { $id = $banana->post->headers['x-org-id']; $_text = formatFrom($_text); - return $_text . ' ' - . 'fiche' - . ''; + return $_text . ' ' + . 'fiche'; } } @@ -39,14 +37,12 @@ function hook_checkcancel($_headers) { function hook_shortcuts() { - global $globals; - return Array('profile' => Array('Préférences', + return Array('profile' => array('Préférences', 'Préférences')); } function hook_makeLink($params) { - global $globals; - $base = $globals->baseurl . '/banana'; + $base = 'banana'; if ($params['subscribe'] == 1) { return $base . '/subscription'; } @@ -81,8 +77,7 @@ function hook_makeLink($params) { function hook_makeImg($img, $alt, $height, $width) { - global $globals; - $url = $globals->baseurl . '/images/banana/' . $img; + $url = 'images/banana/' . $img; if (!is_null($width)) { $width = ' width="' . $width . '"'; @@ -117,7 +112,7 @@ class PlatalBanana extends Banana function PlatalBanana() { global $globals; - + $uid = S::v('uid'); $req = XDB::query( "SELECT nom, mail, sig, FIND_IN_SET('threads',flags), FIND_IN_SET('automaj',flags) diff --git a/include/notifs.inc.php b/include/notifs.inc.php index 71ef1e9..ba3775b 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -133,7 +133,6 @@ function select_notifs($mail, $uid=null, $last=null, $iterator=true) // {{{ function getNbNotifs function getNbNotifs() { - global $globals; if (!S::has('uid')) { return 0; } @@ -145,10 +144,11 @@ function getNbNotifs() { $res = select_notifs(false, $uid, $watchlast, false); $n = $res->numRows(); $res->free(); - $url = $globals->baseurl."/carnet/panel"; - if($n==0) { return; } - if($n==1) { return "1 évènement !"; } - return "$n évènements !"; + if ($n == 0) { + return; + } + + return "$n évènement".($n > 1 ? 's' : '')." !"; } // }}} diff --git a/include/platal/page.inc.php b/include/platal/page.inc.php index b309c67..6238430 100644 --- a/include/platal/page.inc.php +++ b/include/platal/page.inc.php @@ -129,7 +129,7 @@ class PlatalPage extends Smarty $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl')); } - $this->assign('validate', urlencode($globals->baseurl.'/valid.html')); + $this->assign('validate', true); $result = $this->fetch($skin); $ttime .= sprintf('Temps total: %.02fs
', microtime_float() - $TIME_BEGIN); $replc = "VALIDATION HTML INACTIVE
"; diff --git a/include/wiki.inc.php b/include/wiki.inc.php index ae4c888..94d8b0b 100644 --- a/include/wiki.inc.php +++ b/include/wiki.inc.php @@ -33,7 +33,7 @@ function wiki_pagename() { $n = $keywords[$count - 2].".".$keywords[$count - 1]; global $globals; if (($urln = str_replace('.', '/', $n)) != Env::get('n') && $n != Env::get('n')) - redirect($globals->relurl.'/'.$urln); + redirect($globals->baseurl.'/'.$urln); $_REQUEST['n'] = $n; return $n; } diff --git a/include/xorg/menu.inc.php b/include/xorg/menu.inc.php index 0d5b4b8..8e81558 100644 --- a/include/xorg/menu.inc.php +++ b/include/xorg/menu.inc.php @@ -73,10 +73,6 @@ class XOrgMenu function addPublicEntry($head, $prio, $text, $url) { - if (strpos($url, '://') === false) { - global $globals; - $url = $globals->baseurl.'/'.$url; - } $this->_ext[$head][] = Array($prio, 'text' => $text, 'url' => $url); } @@ -85,10 +81,6 @@ class XOrgMenu function addPrivateEntry($head, $prio, $text, $url) { - if (strpos($url, '://') === false) { - global $globals; - $url = $globals->baseurl.'/'.$url; - } $this->_int[$head][] = Array($prio, 'text' => $text, 'url' => $url); } @@ -100,10 +92,10 @@ class XOrgMenu $res = S::logged() ? $this->_int : $this->_ext; if (S::identified()) { $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion', - 'url' => $globals->baseurl.'/exit'); + 'url' => 'exit'); } elseif (Cookie::has('ORGaccess')) { $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion totale', - 'url' => $globals->baseurl.'/exit/forget'); + 'url' => 'exit/forget'); } if (!S::has_perms()) { unset($res[XOM_ADMIN]); diff --git a/modules/profile.php b/modules/profile.php index fc92dba..49a7f59 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -190,7 +190,7 @@ class ProfileModule extends PLModule // photo - $photo = $globals->baseurl.'/photo/'.$user['forlife'].($new ? '/req' : ''); + $photo = 'photo/'.$user['forlife'].($new ? '/req' : ''); if (!isset($user['y']) and !isset($user['x'])) { list($user['x'], $user['y']) = getimagesize("images/none.png"); diff --git a/plugins/function.rel.php b/plugins/function.rel.php index b2bccc8..7e2505d 100644 --- a/plugins/function.rel.php +++ b/plugins/function.rel.php @@ -21,14 +21,7 @@ function smarty_function_rel() { - static $rel; - if (empty($rel)) { - global $globals, $platal; - - $url = parse_url($globals->baseurl); - return ($rel = $url['path']); - } - return $rel; + return '.'; } ?> diff --git a/plugins/pmwiki.config.php b/plugins/pmwiki.config.php index d7d6742..e3d611b 100644 --- a/plugins/pmwiki.config.php +++ b/plugins/pmwiki.config.php @@ -1,6 +1,6 @@ relurl; +$ScriptUrl = $globals->baseurl; $UploadUrlFmt = $ScriptUrl."/uploads"; $WorkDir = $globals->wiki->workdir; $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName'); @@ -39,7 +39,7 @@ $DefaultPasswords['admin'] = 'has_perms: and: identified:'; $DefaultPasswords['upload'] = 'has_perms: and: identified:'; $EnableGUIButtons = 1; -$EnableUpload = 1; +$EnableUpload = 1; $LinkWikiWords = 0; # disable WikiWord links $EnableIMSCaching = 1; # allow browser caching diff --git a/plugins/pmwiki.platalSkin.php b/plugins/pmwiki.platalSkin.php index 634b7fa..5e18ae5 100644 --- a/plugins/pmwiki.platalSkin.php +++ b/plugins/pmwiki.platalSkin.php @@ -11,8 +11,7 @@ $InputTags['e_form'] = array( // set profiles to point to plat/al fiche Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)\|([^\]]*)\]\]/e', - 'PreserveText("=", \'$2\', "")'); + 'PreserveText("=", \'$2\', "")'); // prevent restorelinks before block apply (otherwise [[Sécurité]] will give // .../Se9'>Sécurité diff --git a/templates/admin/homonymes.tpl b/templates/admin/homonymes.tpl index 24b61d6..f92ab08 100644 --- a/templates/admin/homonymes.tpl +++ b/templates/admin/homonymes.tpl @@ -93,7 +93,7 @@ r est ambigu pour des raisons d'homonymie et signalera ton email exact. L'équipe Polytechnique.org -{$baseurl} +{#globals.baseurl#} @@ -118,7 +118,7 @@ L' diff --git a/templates/skin/common.devel.tpl b/templates/skin/common.devel.tpl index 1d49173..209690f 100644 --- a/templates/skin/common.devel.tpl +++ b/templates/skin/common.devel.tpl @@ -36,7 +36,7 @@
@HOOK@ Validation: - CSS + CSS   |   références : XHTML diff --git a/templates/skin/default.tpl b/templates/skin/default.tpl index 45c2234..321d904 100644 --- a/templates/skin/default.tpl +++ b/templates/skin/default.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} {include file=skin/common.bandeau.head.tpl} diff --git a/templates/skin/espace.tpl b/templates/skin/espace.tpl index 595959c..5291b04 100644 --- a/templates/skin/espace.tpl +++ b/templates/skin/espace.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/humlinux.tpl b/templates/skin/humlinux.tpl index 5dcc065..6517653 100644 --- a/templates/skin/humlinux.tpl +++ b/templates/skin/humlinux.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/linux.tpl b/templates/skin/linux.tpl index 2154382..b4629ca 100644 --- a/templates/skin/linux.tpl +++ b/templates/skin/linux.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/liteskin.tpl b/templates/skin/liteskin.tpl index 882a162..5ff3297 100644 --- a/templates/skin/liteskin.tpl +++ b/templates/skin/liteskin.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/nbviolet.tpl b/templates/skin/nbviolet.tpl index 41995b1..3d128aa 100644 --- a/templates/skin/nbviolet.tpl +++ b/templates/skin/nbviolet.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/newxorg.tpl b/templates/skin/newxorg.tpl index 8464b0b..12dc4c9 100644 --- a/templates/skin/newxorg.tpl +++ b/templates/skin/newxorg.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/oldtimes.tpl b/templates/skin/oldtimes.tpl index df84228..4b609d6 100644 --- a/templates/skin/oldtimes.tpl +++ b/templates/skin/oldtimes.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/openweb.tpl b/templates/skin/openweb.tpl index 9913479..6c678e9 100644 --- a/templates/skin/openweb.tpl +++ b/templates/skin/openweb.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} {include file=skin/common.bandeau.head.tpl} diff --git a/templates/skin/sharky.tpl b/templates/skin/sharky.tpl index 0edd7e7..bbc61cd 100644 --- a/templates/skin/sharky.tpl +++ b/templates/skin/sharky.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/spectral.tpl b/templates/skin/spectral.tpl index 9a50352..30a69de 100644 --- a/templates/skin/spectral.tpl +++ b/templates/skin/spectral.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/skin/trapped.tpl b/templates/skin/trapped.tpl index b4717cc..e892762 100644 --- a/templates/skin/trapped.tpl +++ b/templates/skin/trapped.tpl @@ -23,6 +23,7 @@ + {include file=skin/common.header.tpl} diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index a767829..e70598a 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -23,6 +23,7 @@ + Les associations polytechniciennes @@ -39,7 +40,7 @@ {foreach from=$xorg_css item=css} - + {/foreach} {foreach from=$xorg_js item=js} -- 2.1.4