New: Possibilit de choisir son gestionnaire pour le menu de gauche sur le mme principe que celui du haut.

Les gestionnaires sont  placer dans le rpertoire includes/menus/barre_left. Le gestionnaire par defaut ne fait
rien, ce qui quivaut  prendre la gestion courante des menus (bass sur les fichiers pre.inc.php)
This commit is contained in:
Laurent Destailleur 2005-01-01 20:23:49 +00:00
parent a17121f464
commit 837926de30
2 changed files with 12 additions and 10 deletions

View File

@ -27,8 +27,8 @@
\version $Revision$
\remarks La construction d'un gestionnaire pour le menu du haut est simple:
\remarks Toutes les entrées de menu a faire apparaitre dans la barre du
\remarks du haut doit etre affichée par <a class="tmenu" href="lien">Nom</a>
\remarks Toutes les entrées de menu a faire apparaitre dans la barre du haut
\remarks doit etre affichée par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut éventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entrée du menu qui est sélectionné.
*/
@ -52,7 +52,7 @@ if ($conf->commercial->enabled)
$class = 'class="tmenu"';
}
print '<a '.$class.' href="'.DOL_URL_ROOT.'/comm/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Commercial").'</a>';
print '<a '.$class.' href="'.DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial"'.($target?" target=$target":"").'>'.$langs->trans("Commercial").'</a>';
}
@ -74,7 +74,7 @@ if ($conf->adherent->enabled)
$class = 'class="tmenu"';
}
print '<a '.$class.' href="'.DOL_URL_ROOT.'/adherents/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Members").'</a>';
print '<a '.$class.' href="'.DOL_URL_ROOT.'/adherents/index.php?mainmenu=members"'.($target?" target=$target":"").'>'.$langs->trans("Members").'</a>';
}
if ($conf->compta->enabled || $conf->banque->enabled || $conf->caisse->enabled)
@ -95,7 +95,7 @@ if ($conf->compta->enabled || $conf->banque->enabled || $conf->caisse->enabled)
$class = 'class="tmenu"';
}
print '<a '.$class.' href="'.DOL_URL_ROOT.'/compta/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Accountancy")."/".$langs->trans("Treasury").'</a>';
print '<a '.$class.' href="'.DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy"'.($target?" target=$target":"").'>'.$langs->trans("Accountancy")."/".$langs->trans("Treasury").'</a>';
}
@ -122,14 +122,14 @@ if ($conf->produit->enabled || $conf->service->enabled)
if ($conf->service->enabled) { $chaine.="Services"; }
print '<a '.$class.' href="'.DOL_URL_ROOT.'/product/?type=0"'.($target?" target=$target":"").'>'.$chaine.'</a>';
print '<a '.$class.' href="'.DOL_URL_ROOT.'/product/index.php?mainmenu=products"'.($target?" target=$target":"").'>'.$chaine.'</a>';
}
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial")
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "supplier")
{
$class='class="tmenu" id="sel"';
}
@ -142,7 +142,7 @@ if ($conf->produit->enabled || $conf->service->enabled)
$class = 'class="tmenu"';
}
print '<a '.$class.' href="'.DOL_URL_ROOT.'/fourn/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Fournisseur").'</a>';
print '<a '.$class.' href="'.DOL_URL_ROOT.'/fourn/index.php?mainmenu=supplier"'.($target?" target=$target":"").'>'.$langs->trans("Fournisseur").'</a>';
@ -166,7 +166,7 @@ if ($conf->webcal->enabled)
$class = 'class="tmenu"';
}
print '<a '.$class.' href="'.DOL_URL_ROOT.'/projet/webcal.php"'.($target?" target=$target":"").'>'.$langs->trans("Calendar").'</a>';
print '<a '.$class.' href="'.DOL_URL_ROOT.'/projet/webcal.php?mainmenu=webcal"'.($target?" target=$target":"").'>'.$langs->trans("Calendar").'</a>';
};

View File

@ -189,8 +189,10 @@ function top_menu($head, $title="", $target="")
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "accueil") { $class="tmenu"; $id="sel"; }
elseif (ereg("^".DOL_URL_ROOT."\/[^\\\/]+$",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/user\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/admin\/",$_SERVER["PHP_SELF"])) { $class="tmenu"; $id="sel"; }
print '<a class="tmenu" id="'.$id.'" href="'.DOL_URL_ROOT.'/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Home").'</a>';
// Entrée Home du menu
print '<a class="tmenu" id="'.$id.'" href="'.DOL_URL_ROOT.'/index.php?mainmenu=home"'.($target?" target=$target":"").'>'.$langs->trans("Home").'</a>';
// Autres entrées du menu par le gestionnaires
require(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
// Lien sur fiche du login