force 'base href=...../~x......' once for good.
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 17 Jul 2006 20:35:22 +0000 (20:35 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 17 Jul 2006 20:35:22 +0000 (20:35 +0000)
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

26 files changed:
hooks/tmp.inc.php
htdocs/admin/homonymes.php
include/banana.inc.php
include/notifs.inc.php
include/platal/page.inc.php
include/wiki.inc.php
include/xorg/menu.inc.php
modules/profile.php
plugins/function.rel.php
plugins/pmwiki.config.php
plugins/pmwiki.platalSkin.php
templates/admin/homonymes.tpl
templates/skin/common.devel.tpl
templates/skin/default.tpl
templates/skin/espace.tpl
templates/skin/humlinux.tpl
templates/skin/linux.tpl
templates/skin/liteskin.tpl
templates/skin/nbviolet.tpl
templates/skin/newxorg.tpl
templates/skin/oldtimes.tpl
templates/skin/openweb.tpl
templates/skin/sharky.tpl
templates/skin/spectral.tpl
templates/skin/trapped.tpl
templates/xnet/skin.tpl

index 491e97b..808bd36 100644 (file)
@@ -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');
index ff2d3f0..455546e 100644 (file)
@@ -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) {
index 0529996..19dff94 100644 (file)
 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 . ' <a href="' . $globals->baseurl . '/profile/' 
-             . $id . '" class="popup2" title="' . $id . '">'
-             . '<img src="' . $globals->baseurl . '/images/loupe.gif" alt="fiche" title="fiche" />'
-             . '</a>';
+        return $_text . ' <a href="profile/' . $id . '" class="popup2" title="' . $id . '">'
+             . '<img src="images/loupe.gif" alt="fiche" title="fiche" /></a>';
     }
 }
 
@@ -39,14 +37,12 @@ function hook_checkcancel($_headers) {
 
 function hook_shortcuts()
 {
-    global $globals;
-    return Array('profile' => Array('<a href="' . $globals->baseurl . '/banana/profile">Préférences</a>',
+    return Array('profile' => array('<a href="banana/profile">Préférences</a>',
                                     '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)
index 71ef1e9..ba3775b 100644 (file)
@@ -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 "<a href='$url'>1 évènement !</a>"; }
-    return "<a href='$url'>$n évènements !</a>";
+    if ($n == 0) {
+        return;
+    }
+
+    return "<a href='carnet/panel'>$n évènement".($n > 1 ? 's' : '')." !</a>";
 }
 
 // }}}
index b309c67..6238430 100644 (file)
@@ -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<br />', microtime_float() - $TIME_BEGIN);
         $replc  = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
index ae4c888..94d8b0b 100644 (file)
@@ -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;
 }
index 0d5b4b8..8e81558 100644 (file)
@@ -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]);
index fc92dba..49a7f59 100644 (file)
@@ -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");
index b2bccc8..7e2505d 100644 (file)
 
 function smarty_function_rel()
 {
-    static $rel;
-    if (empty($rel)) {
-        global $globals, $platal;
-
-        $url = parse_url($globals->baseurl);
-        return ($rel = $url['path']);
-    }
-    return $rel;
+    return '.';
 }
 
 ?>
index d7d6742..e3d611b 100644 (file)
@@ -1,6 +1,6 @@
 <?php if (!defined('PmWiki')) exit();
 
-$ScriptUrl       = $globals->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
 
index 634b7fa..5e18ae5 100644 (file)
@@ -11,8 +11,7 @@ $InputTags['e_form'] = array(
     
 // set profiles to point to plat/al fiche
 Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)\|([^\]]*)\]\]/e',
-    'PreserveText("=", \'<a href="'.$globals->baseurl
-    .'/profile/$1" class="popup2">$2</a>\', "")');
+    'PreserveText("=", \'<a href="profile/$1" class="popup2">$2</a>\', "")');
 
 // prevent restorelinks before block apply (otherwise [[Sécurité]] will give
 //  .../S<span class='e9curit'>e9'>Sécurité</a>
index 24b61d6..f92ab08 100644 (file)
@@ -93,7 +93,7 @@ r
 est ambigu pour des raisons d'homonymie et signalera ton email exact.
 
 L'équipe Polytechnique.org
-{$baseurl}
+{#globals.baseurl#}
         </textarea>
       </td>
     </tr>
@@ -118,7 +118,7 @@ L'
       <td>
         <textarea cols="80" rows="20" name="mailbody">
 {$prenom},
-          
+
 Comme nous t'en avons informé par mail il y a quelques temps,
 nous t'avons retiré de façon définitive l'adresse
 {$loginbis}@polytechnique.org.
@@ -130,7 +130,7 @@ est ambigu pour des raisons d'homonymie et signale ton email exact
 Tu peux faire l'essai toi-même en écrivant à {$loginbis}@polytechnique.org.
 
 L'équipe Polytechnique.org
-{$baseurl}
+{#globals.baseurl#}
         </textarea>
       </td>
     </tr>
index 1d49173..209690f 100644 (file)
@@ -36,7 +36,7 @@
   <div id="dev">
     @HOOK@
     Validation:
-    <a href="http://jigsaw.w3.org/css-validator/validator?uri={$validate}">CSS</a>
+    <a href="http://jigsaw.w3.org/css-validator/validator?uri={#globals.baseurl#}/valid.html">CSS</a>
     &nbsp;&nbsp;|&nbsp;&nbsp;
     références :
     <a href="http://www.w3schools.com/xhtml/xhtml_reference.asp">XHTML</a>
index 45c2234..321d904 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     {include file=skin/common.header.tpl}
     {include file=skin/common.bandeau.head.tpl}
index 595959c..5291b04 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/espace.css" media="screen" />
     {include file=skin/common.header.tpl}
index 5dcc065..6517653 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/humlinux.css" media="screen" />
     {include file=skin/common.header.tpl}
index 2154382..b4629ca 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/linux.css" media="screen" />
     {include file=skin/common.header.tpl}
index 882a162..5ff3297 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/liteskin.css" media="screen" />
     {include file=skin/common.header.tpl}
index 41995b1..3d128aa 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/nbviolet.css" media="screen" />
     {include file=skin/common.header.tpl}
index 8464b0b..12dc4c9 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/newxorg.css" media="screen" />
     {include file=skin/common.header.tpl}
index df84228..4b609d6 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/oldtimes.css" media="screen" />
     {include file=skin/common.header.tpl}
index 9913479..6c678e9 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/openweb.css" media="screen" />
     {include file=skin/common.header.tpl}
     {include file=skin/common.bandeau.head.tpl}
index 0edd7e7..bbc61cd 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/sharky.css" media="screen" />
     {include file=skin/common.header.tpl}
index 9a50352..30a69de 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/spectral.css" media="screen" />
     {include file=skin/common.header.tpl}
index b4717cc..e892762 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}/" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/default.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="{rel}/css/trapped.css" media="screen" />
     {include file=skin/common.header.tpl}
index a767829..e70598a 100644 (file)
@@ -23,6 +23,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
+    <base href="{#globals.baseurl#}" />
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
     <title>Les associations polytechniciennes</title>
@@ -39,7 +40,7 @@
     <link rel="bookmark" href="http://www.polytechnique.fr/eleves/" title="| Site d'élèves" />
 
     {foreach from=$xorg_css item=css}
-    <link rel="stylesheet" type="text/css" href="{rel}/{$css}" />
+    <link rel="stylesheet" type="text/css" href="{rel}/css/{$css}" />
     {/foreach}
     {foreach from=$xorg_js item=js}
     <script type="text/javascript" src="{rel}/{$js}"></script>