From 07dc449578fa5a92f3400858510a8cd3f0c8ce42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Apr 2007 00:45:42 +0000 Subject: [PATCH] La config des gestionnaires de menu est mise a part. --- htdocs/admin/menus.php | 176 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 htdocs/admin/menus.php diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php new file mode 100644 index 00000000000..a68027a1154 --- /dev/null +++ b/htdocs/admin/menus.php @@ -0,0 +1,176 @@ + + * 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 + * 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/admin/łenus.php + \brief Page de configuration des gestionnaires de menu + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("companies"); +$langs->load("products"); +$langs->load("admin"); + +if (!$user->admin) + accessforbidden(); + +$dirtop = "../includes/menus/barre_top"; +$dirleft = "../includes/menus/barre_left"; + + +/* +* Actions +*/ + +if (isset($_POST["action"]) && $_POST["action"] == 'update') +{ + 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"]); + + $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer + + Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + + +/* +* Affichage +*/ + +$html=new Form($db); + +llxHeader(); + +print_fiche_titre($langs->trans("Menus"),'','setup'); + +print $langs->trans("MenusDesc")."
\n"; +print "
\n"; + + +if (isset($_GET["action"]) && $_GET["action"] == 'edit') +{ + print '
'; + print ''; + + clearstatcache(); + + // 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").''; + print $html->textwithhelp($langs->trans("InternalUsers"),$langs->trans("InternalExternalDesc")); + print ''; + print $html->textwithhelp($langs->trans("ExternalUsers"),$langs->trans("InternalExternalDesc")); + print '
'.$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 '
'; + + print '
'; + print ''; + print '
'; + + print '

'; +} +else +{ + // 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").''; + print $html->textwithhelp($langs->trans("InternalUsers"),$langs->trans("InternalExternalDesc")); + print ''; + print $html->textwithhelp($langs->trans("ExternalUsers"),$langs->trans("InternalExternalDesc")); + print '
'.$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 '
'; + + print '
'; + print ''.$langs->trans("Edit").''; + print '
'; +} + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?>