From 0a65715ad91c5ba2c211dd461315ddf69c9d452d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Jan 2005 19:17:28 +0000 Subject: [PATCH] Modif gestionnaire menu eldy --- htdocs/includes/menus/barre_left/eldy.php | 3 +- htdocs/includes/menus/barre_top/eldy.php | 194 ++++++++++++++++++++++ 2 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 htdocs/includes/menus/barre_top/eldy.php diff --git a/htdocs/includes/menus/barre_left/eldy.php b/htdocs/includes/menus/barre_left/eldy.php index 3535cd4ff13..7fc246cfd13 100644 --- a/htdocs/includes/menus/barre_left/eldy.php +++ b/htdocs/includes/menus/barre_left/eldy.php @@ -362,7 +362,8 @@ if ($mainmenu) { if($user->admin) { $langs->load("admin"); - $newmenu->add(DOL_URL_ROOT."/comm/mailing.php?mainmenu=outils", $langs->trans("Mailings")); + $newmenu->add(DOL_URL_ROOT."/comm/mailing/index.php?mainmenu=tools", $langs->trans("Mailings")); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/mailing/fiche.php?action=create", $langs->trans("NewMailing")); } } diff --git a/htdocs/includes/menus/barre_top/eldy.php b/htdocs/includes/menus/barre_top/eldy.php new file mode 100644 index 00000000000..837723e8299 --- /dev/null +++ b/htdocs/includes/menus/barre_top/eldy.php @@ -0,0 +1,194 @@ + + * Copyright (C) 2004 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ + +/** + \file htdocs/includes/menus/barre_top/eldy.php + \brief Gestionnaire par défaut du menu du haut + \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 haut + \remarks doit etre affichée par ... + \remarks On peut éventuellement ajouter l'attribut id="sel" dans la balise + \remarks quand il s'agit de l'entrée du menu qui est sélectionné. +*/ + + +if ($conf->commercial->enabled) +{ + $langs->load("commercial"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/comm\/",$_SERVER["PHP_SELF"]) && ! ereg("^".DOL_URL_ROOT."\/comm\/mailing\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print ''.$langs->trans("Commercial").''; + +} + +if ($conf->adherent->enabled) +{ + $langs->load("members"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "adherent") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/adherents\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print ''.$langs->trans("Members").''; +} + +if ($conf->compta->enabled || $conf->banque->enabled || $conf->caisse->enabled) +{ + $langs->load("compta"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "compta") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/compta\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print ''.$langs->trans("Accountancy")."/".$langs->trans("Treasury").''; + +} + +if ($conf->produit->enabled || $conf->service->enabled) +{ + $langs->load("products"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "product") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/product\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + $chaine=""; + if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } + if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } + if ($conf->service->enabled) { $chaine.="Services"; } + + + print ''.$chaine.''; + +} + + +if ($conf->fournisseur->enabled) +{ + $langs->load("suppliers"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "supplier") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/fourn\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print ''.$langs->trans("Suppliers").''; +} + + +if ($conf->webcal->enabled) +{ + $langs->load("other"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "webcalendar") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/projet\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print ''.$langs->trans("Calendar").''; +}; + + + $langs->load("other"); + + $class=""; + if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "tools") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT."\/comm\/mailing\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/comm\/mailing\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print ''.$langs->trans("Tools").''; + + + +?>