From 8923d1f2b3322e3f5a7d2deaa96c849ad587a1f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Apr 2007 19:21:22 +0000 Subject: [PATCH] La config des gestionnaires de menu est mise a part. --- htdocs/admin/ihm.php | 92 ++----------------- htdocs/admin/pre.inc.php | 2 + .../menus/barre_left/eldy_backoffice.php | 1 + .../menus/barre_left/eldy_frontoffice.php | 1 + .../menus/barre_top/eldy_backoffice.php | 37 +++++++- .../menus/barre_top/eldy_frontoffice.php | 37 +++++++- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 8 files changed, 83 insertions(+), 89 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 37c8c9848bd..5bdec59c9eb 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 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 @@ -22,7 +22,7 @@ /** \file htdocs/admin/ihm.php - \brief Page de configuration du de l'interface homme machine + \brief Page de configuration de l'interface homme machine \version $Revision$ */ @@ -37,8 +37,6 @@ if (!$user->admin) if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); -$dirtop = "../includes/menus/barre_top"; -$dirleft = "../includes/menus/barre_left"; $dirtheme = "../theme"; // Liste des zone de recherche permanantes supportées @@ -60,12 +58,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_SHOW_BUGTRACK_LINK", $_POST["main_show_bugtrack_link"]); dolibarr_set_const($db, "MAIN_SHOW_WORKBOARD", $_POST["main_show_workboard"]); - dolibarr_set_const($db, "MAIN_MENU_BARRETOP", $_POST["main_menu_barretop"]); - dolibarr_set_const($db, "MAIN_MENU_BARRELEFT", $_POST["main_menu_barreleft"]); - - dolibarr_set_const($db, "MAIN_MENUFRONT_BARRETOP", $_POST["main_menufront_barretop"]); - dolibarr_set_const($db, "MAIN_MENUFRONT_BARRELEFT",$_POST["main_menufront_barreleft"]); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"]); dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["main_searchform_contact"]); @@ -76,7 +68,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer - Header("Location: ihm.php?mainmenu=home&leftmenu=setup"); + Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -91,7 +83,9 @@ print "
\n"; if (isset($_GET["action"]) && $_GET["action"] == 'edit') { - print '
'; + $html=new Form($db); + + print ''; print ''; clearstatcache(); @@ -103,7 +97,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Langue par defaut $var=!$var; print ''.$langs->trans("DefaultLanguage").''; - $html=new Form($db); $html->select_lang($conf->global->MAIN_LANG_DEFAULT,'main_lang_default',1); print ''; @@ -159,40 +152,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print '
'; - // Gestionnaires de menu - $var=true; - - print ''; - print ''; - print ''; - print ''; - print ''; - - // Menu top - $var=!$var; - print ''; - print ''; - print ''; - print ''; - - // Menu left - $var=!$var; - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Menu").''.$langs->trans("InternalUsers").''.$langs->trans("ExternalUsers").'
'.$langs->trans("DefaultMenuTopManager").''; - print $html->select_menu($conf->global->MAIN_MENU_BARRETOP,'main_menu_barretop',$dirtop); - print ''; - print $html->select_menu($conf->global->MAIN_MENUFRONT_BARRETOP,'main_menufront_barretop',$dirtop); - print '
'.$langs->trans("DefaultMenuLeftManager").''; - print $html->select_menu($conf->global->MAIN_MENU_BARRELEFT,'main_menu_barreleft',$dirleft); - print ''; - print $html->select_menu($conf->global->MAIN_MENUFRONT_BARRELEFT,'main_menufront_barreleft',$dirleft); - print '

'; - - // Themes show_theme(1); print '
'; @@ -289,43 +248,6 @@ else print '
'; - // Gestionnaires de menu - $var=true; - - print ''; - print ''; - print ''; - print ''; - print ''; - - $var=!$var; - print ''; - print ''; - print ''; - print ''; - - $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Menu").''.$langs->trans("InternalUsers").''.$langs->trans("ExternalUsers").'
'.$langs->trans("DefaultMenuTopManager").''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENU_BARRETOP); - print $filelib; - print ''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENUFRONT_BARRETOP); - print $filelib; - print '
'.$langs->trans("DefaultMenuLeftManager").''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENU_BARRELEFT); - print $filelib; - print ''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENUFRONT_BARRELEFT); - print $filelib; - print '

'; - - // Themes show_theme(0); print '
'; @@ -353,7 +275,7 @@ else print ''; print '
'; - print ''.$langs->trans("Edit").''; + print ''.$langs->trans("Edit").''; print '
'; } diff --git a/htdocs/admin/pre.inc.php b/htdocs/admin/pre.inc.php index 6e815c1473c..1c0902aa5bb 100644 --- a/htdocs/admin/pre.inc.php +++ b/htdocs/admin/pre.inc.php @@ -46,6 +46,8 @@ function llxHeader($head = "", $title="", $help_url='') $menu->add(DOL_URL_ROOT."/admin/modules.php", $langs->trans("Modules")); + $menu->add(DOL_URL_ROOT."/admin/menus.php", $langs->trans("Menus")); + $menu->add(DOL_URL_ROOT."/admin/ihm.php", $langs->trans("GUISetup")); $menu->add(DOL_URL_ROOT."/admin/boxes.php", $langs->trans("Boxes")); diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 712594a444a..a9f6de5d8d5 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -127,6 +127,7 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/admin/index.php?leftmenu=setup", $langs->trans("Setup")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/company.php", $langs->trans("MenuCompanySetup")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/modules.php", $langs->trans("Modules")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/menus.php", $langs->trans("Menus")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/ihm.php", $langs->trans("GUISetup")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/boxes.php", $langs->trans("Boxes")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/delais.php",$langs->trans("Alerts")); diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index cac32d921a7..afe4d485852 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -130,6 +130,7 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/admin/index.php?leftmenu=setup", $langs->trans("Setup")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/company.php", $langs->trans("MenuCompanySetup")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/modules.php", $langs->trans("Modules")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/menus.php", $langs->trans("Menus")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/ihm.php", $langs->trans("GUISetup")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/boxes.php", $langs->trans("Boxes")); if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/delais.php",$langs->trans("Alerts")); diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index 01e10c2eebc..2885857867c 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -212,7 +212,7 @@ class MenuTop { print ''.$langs->trans("MenuFinancial").''; } - // Projets + // Projects if ($conf->projet->enabled) { $langs->load("projects"); @@ -256,7 +256,40 @@ class MenuTop { print ''.$langs->trans("Tools").''; } - // OSCommerce 1 + // Telephonie + if ($conf->telephonie->enabled && $user->rights->telephonie->lire) + { + $class=""; + if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print 'atarget?" target=$this->atarget":"").'>Telephonie'; + } + + // Energie + if ($conf->energie->enabled) + { + $langs->load("energy"); + $class=""; + if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").''; + } + + // OSCommerce 1 if ($conf->boutique->enabled) { $langs->load("shop"); diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php index 7701257dfe5..a4608642549 100644 --- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php @@ -201,7 +201,7 @@ class MenuTop { print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuFinancial").''; } - // Projets + // Projects if ($conf->projet->enabled) { $langs->load("projects"); @@ -279,7 +279,40 @@ class MenuTop { print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("BugTracker").''; } - // Members + // Telephonie + if ($conf->telephonie->enabled && $user->rights->telephonie->lire) + { + $class=""; + if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print 'atarget?" target=$this->atarget":"").'>Telephonie'; + } + + // Energie + if ($conf->energie->enabled) + { + $langs->load("energy"); + $class=""; + if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").''; + } + + // Members if ($conf->adherent->enabled) { $langs->load("members"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 218672420c4..a5eaeda5388 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -50,6 +50,7 @@ Box=Box Boxes=Boxes PositionByDefault=Default order Position=Order +MenusDesc=Menus managers define content of the 2 menu bars (horizontal bar and vertical bar). System=System SystemInfo=System information SystemTools=System tools diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 1f44573b12b..3e871c39f78 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -50,6 +50,7 @@ Box=Bo Boxes=Boîtes PositionByDefault=Position par défaut Position=Ordre +MenusDesc=Les gestionnaires de menu définissent le contenu des 2 barres de menus (la barre horizontale et la barre verticale). Il est possible de mettre un gestionnaire différent selon que l'utilisateur soit interne ou externe. System=Système SystemInfo=Infos Système SystemTools=Outils Système