Remplacement de PHP_SELF. Notons qu'ici, il n'est pas possible de mettre en dur le nom de la page (car le fichier est inclus dans plusieurs d'entre elles), donc on remplace par $_SERVER["PHP_SELF"]

This commit is contained in:
Laurent Destailleur 2004-07-24 23:22:32 +00:00
parent f8dea2283d
commit 1ea0b594b7

View File

@ -21,8 +21,6 @@
*
*/
global $PHP_SELF;
$nbofentries=0;
if ($conf->commercial->enabled) $nbofentries++;
if ($conf->adherent->enabled) $nbofentries++;
@ -43,7 +41,7 @@ else
{
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial") { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/comm\/",$PHP_SELF)) { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/comm\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/comm/index.php"'.($target?" target=$target":"").'>Commercial</A>';
print '</td>';
@ -53,7 +51,7 @@ else
{
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "adherent") { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/adherents\/",$PHP_SELF)) { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/adherents\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/adherents/index.php"'.($target?" target=$target":"").'>Adhérents</A>';
print '</td>';
@ -63,7 +61,7 @@ else
{
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "compta") { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/compta\/",$PHP_SELF)) { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/compta\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/compta/index.php"'.($target?" target=$target":"").'>Compta/Tréso</A>';
print '</td>';
@ -73,7 +71,7 @@ else
{
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "product") { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/product\/",$PHP_SELF)) { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/product\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
$chaine="";
if ($conf->produit->enabled) { $chaine.="Produits"; }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
@ -87,7 +85,7 @@ else
{
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "webcalendar") { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/projet\/",$PHP_SELF) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$PHP_SELF)) { $class="menusel"; }
elseif (ereg("^".DOL_URL_ROOT."\/projet\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
// print '<a class="'.$class.'" href="'. PHPWEBCALENDAR_URL .'">Calendrier</a>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/projet/webcal.php"'.($target?" target=$target":"").'>Calendrier</a>';