From f5494dbc8257baa021234152405cbbde83d3a64a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Sep 2005 15:36:41 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Dans=20gestion=20menu=20top=20par=20defa?= =?UTF-8?q?ut,=20on=20pouvait=20avoir=20le=20menu=20projet=20et=20webcalen?= =?UTF-8?q?dar=20s=E9lectionn=E9s=20tous=20les=20deux.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/includes/menus/barre_top/default.php | 64 +++++++++++---------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/htdocs/includes/menus/barre_top/default.php b/htdocs/includes/menus/barre_top/default.php index f8e4e5f7e46..03130f01275 100644 --- a/htdocs/includes/menus/barre_top/default.php +++ b/htdocs/includes/menus/barre_top/default.php @@ -164,21 +164,24 @@ class MenuTop { // Entrée projets if ($conf->projet->enabled && $user->rights->projet->lire) { - $langs->load("projects"); - - $class=""; - - if (ereg("^".DOL_URL_ROOT."\/projet\/",$_SERVER["PHP_SELF"])) + $langs->load("projects"); + + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "product") { - $class='class="tmenu" id="sel"'; + $class='class="tmenu" id="sel"'; } - else - { - $class = 'class="tmenu"'; + if (ereg("^".DOL_URL_ROOT."\/projet\/[^w]",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; } - - $chaine.=$langs->trans("Projects"); - print ''.$chaine.''; + else + { + $class = 'class="tmenu"'; + } + + $chaine.=$langs->trans("Projects"); + print ''.$chaine.''; } // Entrée produit/service @@ -202,7 +205,7 @@ class MenuTop { $chaine=""; if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } - if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } + if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } print 'atarget?" target=$this->atarget":"").'>'.$chaine.''; @@ -233,36 +236,35 @@ class MenuTop { // Entrée telephonie if ($conf->telephonie->enabled && $user->rights->telephonie->lire) { - $class=""; - if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) + $class=""; + if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) { - $class='class="tmenu" id="sel"'; + $class='class="tmenu" id="sel"'; } - else + else { - $class = 'class="tmenu"'; + $class = 'class="tmenu"'; } - - print 'atarget?" target=$this->atarget":"").'>Telephonie'; + + print 'atarget?" target=$this->atarget":"").'>Telephonie'; } - + // Entrée energie if ($conf->energie->enabled) { - $langs->load("energy"); - $class=""; - if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"])) + $langs->load("energy"); + $class=""; + if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"])) { - $class='class="tmenu" id="sel"'; + $class='class="tmenu" id="sel"'; } - else + else { - $class = 'class="tmenu"'; + $class = 'class="tmenu"'; } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").''; + + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").''; } - // Entrée webcal if ($conf->webcal->enabled) @@ -274,7 +276,7 @@ class MenuTop { { $class='class="tmenu" id="sel"'; } - elseif (ereg("^".DOL_URL_ROOT."\/projet\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$_SERVER["PHP_SELF"])) + elseif (ereg("^".DOL_URL_ROOT.".*\/webcal",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$_SERVER["PHP_SELF"])) { $class='class="tmenu" id="sel"'; }