* Copyright (C) 2004-2005 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/ihm.php \brief Page de configuration du de l'interface homme machine \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"; $dirtheme = "../theme"; // Liste des zone de recherche permanantes supportées $searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice"); $searchformconst=array(MAIN_SEARCHFORM_SOCIETE,MAIN_SEARCHFORM_CONTACT,MAIN_SEARCHFORM_PRODUITSERVICE); $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices")); if ($_POST["action"] == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"]); 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_THEME", $_POST["main_theme"]); dolibarr_set_const($db, "SIZE_LISTE_LIMIT", $_POST["size_liste_limit"]); dolibarr_set_const($db, "MAIN_MOTD", trim($_POST["main_motd"])); dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT",$_POST["main_searchform_contact"]); dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE",$_POST["main_searchform_societe"]); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["main_searchform_produitservice"]); $_SESSION["mainmenu"]=""; Header("Location: ihm.php?mainmenu=home&leftmenu=setup"); } llxHeader(); if (!defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD))) { define("MAIN_MOTD",""); } print_titre($langs->trans("GUISetup")); print "
\n"; if ($_GET["action"] == 'edit') { print '
'; print ''; clearstatcache(); $var=true; print ''; print ''; // Langue par defaut $var=!$var; print ''; // Menu top $var=!$var; print ''; print ''; // Menu left $var=!$var; print ''; print ''; // Taille max des listes $var=!$var; print ''; // Message of the day $var=!$var; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DefaultLanguage").''; $html=new Form($db); $html->select_lang(MAIN_LANG_DEFAULT,'main_lang_default'); print '
'.$langs->trans("MenuTopManager").''; print '
'.$langs->trans("MenuLeftManager").''; print '
'.$langs->trans("MaxSizeList").'
'.$langs->trans("MessageOfDay").'

'; // Theme show_theme(1); print '
'; // Liste des zone de recherche permanantes supportées print ''; print ''; $var=True; foreach ($searchform as $key => $value) { $var=!$var; print ''; } print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; $html->selectyesnonum($searchform[$key],$searchformconst[$key]); print '
'; print '
'; print ''; print '
'; print '
'; } else { $var=true; print ''; print ''; $var=!$var; print ''; $var=!$var; print ''; $var=!$var; print ''; $var=!$var; print ''; $var=!$var; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DefaultLanguage").'' . MAIN_LANG_DEFAULT . '
'.$langs->trans("MenuTopManager").''; $filelib=eregi_replace('\.php$','',MAIN_MENU_BARRETOP); print $filelib; print '
'.$langs->trans("MenuLeftManager").''; $filelib=eregi_replace('\.php$','',MAIN_MENU_BARRELEFT); print $filelib; print '
'.$langs->trans("MaxSizeList").'' . SIZE_LISTE_LIMIT . '
'.$langs->trans("MessageOfDay").'' . stripslashes(nl2br(MAIN_MOTD)) . '

'; // Skin show_theme(0); print '
'; // Liste des zone de recherche permanantes supportées print ''; print ''; $var=True; foreach ($searchform as $key => $value) { $var=!$var; print ''; } print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].'' . ($searchformconst[$key]?$langs->trans("yes"):$langs->trans("no")) . '
'; print '
'; print ''.$langs->trans("Edit").''; print '
'; } function show_theme($edit=0) { global $langs,$dirtheme,$bc; $nbofthumbs=5; print ''; print ''; $handle=opendir($dirtheme); $var=false; $i=0; while (($subdir = readdir($handle))!==false) { if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS') { if ($i % $nbofthumbs == 0) { print ''; } print ''; $i++; if ($i % $nbofthumbs == 0) print ''; } } if ($i % $nbofthumbs != 0) { while ($i % $nbofthumbs != 0) { print ''; $i++; } print ''; } print '
'.$langs->trans("Skin").'
'; $file=$dirtheme."/".$subdir."/thumb.png"; if (! file_exists($file)) $file=$dirtheme."/nophoto.jpg"; print '
'; if ($subdir == MAIN_THEME) { print ' '.$subdir.''; } else { print ' '.$subdir; } print '
 
'; } llxFooter('$Date$ - $Revision$'); ?>