diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 7a71eff2208..809d9566599 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * 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 @@ -21,9 +21,9 @@ */ /** - \file htdocs/admin/ihm.php + \file htdocs/admin/ihm.php \brief Page de configuration du de l'interface homme machine - \version $Revision$ + \version $Revision$ */ require("./pre.inc.php"); @@ -34,9 +34,13 @@ $langs->load("admin"); if (!$user->admin) - accessforbidden(); +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); @@ -46,21 +50,21 @@ $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$lan 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, "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, "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"]); + 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"); + $_SESSION["mainmenu"]=""; + + Header("Location: ihm.php?mainmenu=home&leftmenu=setup"); } @@ -68,7 +72,7 @@ llxHeader(); if (!defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD))) { - define("MAIN_MOTD",""); + define("MAIN_MOTD",""); } print_titre($langs->trans("GUISetup")); @@ -79,154 +83,203 @@ print "
\n"; if ($_GET["action"] == 'edit') { - print '
'; + print ''; + print ''; - clearstatcache(); + clearstatcache(); + $var=true; + + print ''; + print ''; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - print ''; - - // Langue par defaut - print ''; - - // Menu top - print ''; - print ''; - - // Menu left - print ''; - print ''; - - // Theme - print ''; - print ''; - - // Taille max des listes - print ''; - - // Message of the day - 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("Skin").''; - print ''; - print '
'.$langs->trans("MaxSizeList").'
'.$langs->trans("MessageOfDay").'

'; - - // Liste des zone de recherche permanantes supportées - print ''; - print ''; - $var=True; - foreach ($searchform as $key => $value) { + // Langue par defaut $var=!$var; - print ''; - } - print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; - $html->selectyesnonum($searchform[$key],$searchformconst[$key]); + print '
'.$langs->trans("DefaultLanguage").''; + $html=new Form($db); + $html->select_lang(MAIN_LANG_DEFAULT,'main_lang_default'); print '

'; - print '
'; - print ''; - print '
'; + // Menu top + $var=!$var; + print ''.$langs->trans("MenuTopManager").''; + print ''; + print ''; + + // Menu left + $var=!$var; + print ''.$langs->trans("MenuLeftManager").''; + print ''; + print ''; + + // Taille max des listes + $var=!$var; + print ''.$langs->trans("MaxSizeList").''; + + // Message of the day + $var=!$var; + print ''.$langs->trans("MessageOfDay").''; + + print '
'; + + + // 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 ''; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - 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("Skin").'' . MAIN_THEME . '
'.$langs->trans("MaxSizeList").'' . SIZE_LISTE_LIMIT . '
'.$langs->trans("MessageOfDay").'' . stripslashes(nl2br(MAIN_MOTD)) . '

'; - - // 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 ''.$langs->trans("DefaultLanguage").'' . MAIN_LANG_DEFAULT . ''; - print '
'; - print ''.$langs->trans("Edit").''; - print '
'; + $var=!$var; + print ''.$langs->trans("MenuTopManager").''; + $filelib=eregi_replace('\.php$','',MAIN_MENU_BARRETOP); + print $filelib; + print ''; + + $var=!$var; + print ''.$langs->trans("MenuLeftManager").''; + $filelib=eregi_replace('\.php$','',MAIN_MENU_BARRELEFT); + print $filelib; + print ''; + + $var=!$var; + print ''.$langs->trans("MaxSizeList").'' . SIZE_LISTE_LIMIT . ''; + + $var=!$var; + print ''.$langs->trans("MessageOfDay").'' . stripslashes(nl2br(MAIN_MOTD)) . ''; + + print '
'; + + + // 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 '
'; } -llxFooter("Dernière modification $Date$ révision $Revision$"); +function show_theme($edit=0) +{ + global $langs,$dirtheme,$bc; + + $nbofthumbs=4; + print ''; + print ''; + + $handle=opendir($dirtheme); + $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$'); ?> diff --git a/htdocs/theme/dev/thumb.png b/htdocs/theme/dev/thumb.png new file mode 100644 index 00000000000..2f3233305cd Binary files /dev/null and b/htdocs/theme/dev/thumb.png differ diff --git a/htdocs/theme/eldy/thumb.png b/htdocs/theme/eldy/thumb.png new file mode 100644 index 00000000000..75792e46294 Binary files /dev/null and b/htdocs/theme/eldy/thumb.png differ diff --git a/htdocs/theme/freelug/thumb.png b/htdocs/theme/freelug/thumb.png new file mode 100644 index 00000000000..7f06a93564f Binary files /dev/null and b/htdocs/theme/freelug/thumb.png differ diff --git a/htdocs/theme/yellow/thumb.png b/htdocs/theme/yellow/thumb.png new file mode 100644 index 00000000000..f82cc5c65ee Binary files /dev/null and b/htdocs/theme/yellow/thumb.png differ