2004-02-13 23:42:47 +01:00
< ? PHP
/* Copyright ( C ) 2001 - 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 Laurent Destailleur < eldy @ users . sourceforge . net >
*
* 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 $
*/
2004-08-29 14:01:58 +02:00
/*!
\file htdocs / admin / ihm . php
\brief Page de configuration du de l ' interface homme machine
\version $Revision $
*/
2004-02-13 23:42:47 +01:00
require ( " ./pre.inc.php " );
2004-08-14 00:10:58 +02:00
$langs -> load ( " companies " );
$langs -> load ( " products " );
2004-09-04 12:11:17 +02:00
$langs -> load ( " admin " );
2004-08-14 00:10:58 +02:00
2004-02-15 01:05:21 +01:00
if ( ! $user -> admin )
accessforbidden ();
2004-08-14 00:10:58 +02:00
// Liste des zone de recherche permanantes support<72> 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 " ));
2004-06-09 03:30:26 +02:00
if ( $_POST [ " action " ] == 'update' )
2004-02-13 23:42:47 +01:00
{
2004-07-26 14:31:16 +02:00
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_MENU_BARRETOP " , $_POST [ " main_menu_barretop " ]);
dolibarr_set_const ( $db , " MAIN_LANG_DEFAULT " , $_POST [ " main_lang_default " ]);
dolibarr_set_const ( $db , " MAIN_MOTD " , trim ( $_POST [ " main_motd " ]));
2004-02-13 23:42:47 +01:00
2004-08-14 00:10:58 +02:00
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 " ]);
2004-07-21 10:05:12 +02:00
Header ( " Location: ihm.php " );
2004-02-13 23:42:47 +01:00
}
llxHeader ();
2004-07-26 14:31:16 +02:00
if ( ! defined ( " MAIN_MOTD " ) && strlen ( trim ( MAIN_MOTD )))
{
define ( " MAIN_MOTD " , " " );
}
2004-08-05 03:44:51 +02:00
print_titre ( $langs -> trans ( " GUISetup " ));
2004-02-13 23:42:47 +01:00
print " <br> \n " ;
2004-08-14 00:10:58 +02:00
2004-02-13 23:42:47 +01:00
if ( $_GET [ " action " ] == 'edit' )
{
2004-07-21 10:05:12 +02:00
print '<form method="post" action="ihm.php">' ;
2004-02-13 23:42:47 +01:00
2004-09-04 14:21:59 +02:00
print '<table class="noborder" width="100%">' ;
2004-07-31 13:36:01 +02:00
print '<tr class="liste_titre"><td>' . $langs -> trans ( " Parameter " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' ;
2004-02-13 23:42:47 +01:00
2004-09-04 14:21:59 +02:00
print '<tr class="impair"><td>' . $langs -> trans ( " Skin " ) . '</td>' ;
2004-02-13 23:42:47 +01:00
print '<td><select name="main_theme">' ;
clearstatcache ();
$dir = " ../theme/ " ;
$handle = opendir ( $dir );
while (( $file = readdir ( $handle )) !== false )
{
if ( is_dir ( $dir . $file ) && substr ( $file , 0 , 1 ) <> '.' && substr ( $file , 0 , 3 ) <> 'CVS' )
{
if ( $file == MAIN_THEME )
{
print '<option value="' . $file . '" selected>' . $file ;
}
else
{
print '<option value="' . $file . '">' . $file ;
}
}
}
2004-02-28 17:53:21 +01:00
print '</select>' ;
2004-02-27 23:44:18 +01:00
print '<input type="hidden" name="action" value="update">' ;
2004-02-13 23:42:47 +01:00
print '</td></tr>' ;
2004-02-27 23:44:18 +01:00
print '<tr class="pair"><td width="50%">Longueur maximum des listes</td><td><input name="size_liste_limit" size="20" value="' . SIZE_LISTE_LIMIT . '"></td></tr>' ;
2004-05-17 19:30:54 +02:00
print '<tr class="impair"><td width="50%">Gestionnaire du menu du haut</td>' ;
print '<td><select name="main_menu_barretop">' ;
$dir = " ../includes/menus/barre_top/ " ;
$handle = opendir ( $dir );
while (( $file = readdir ( $handle )) !== false )
{
if ( is_file ( $dir . $file ) && substr ( $file , 0 , 1 ) <> '.' && substr ( $file , 0 , 3 ) <> 'CVS' )
{
$filelib = eregi_replace ( '\.php$' , '' , $file );
if ( $file == MAIN_MENU_BARRETOP )
{
print '<option value="' . $file . '" selected>' . $filelib . '</option>' ;
}
else
{
print '<option value="' . $file . '">' . $filelib . '</option>' ;
}
}
}
print '</select>' ;
print '</td></tr>' ;
2004-02-13 23:42:47 +01:00
2004-09-04 14:21:59 +02:00
print '<tr class="pair"><td width="50%">' . $langs -> trans ( " DefaultLanguage " ) . '</td><td>' ;
2004-08-08 17:16:06 +02:00
$html = new Form ( $db );
$html -> select_lang ( MAIN_LANG_DEFAULT , 'main_lang_default' );
2004-06-10 00:05:49 +02:00
print '</td></tr>' ;
2004-09-04 14:21:59 +02:00
print '<tr class="impair"><td width="50%">' . $langs -> trans ( " MessageOfDay " ) . '</td><td><textarea cols="40" rows="3" name="main_motd" size="20">' . stripslashes ( MAIN_MOTD ) . '</textarea></td></tr>' ;
2004-07-26 14:31:16 +02:00
2004-08-14 00:10:58 +02:00
print '</table><br>' ;
2004-07-26 14:31:16 +02:00
2004-08-14 00:10:58 +02:00
// Liste des zone de recherche permanantes support<72> es
2004-09-04 14:21:59 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre"><td>' . $langs -> trans ( " PermanentLeftSearchForm " ) . '</td><td>' . $langs -> trans ( " Activated " ) . '</td></tr>' ;
2004-08-14 00:10:58 +02:00
$var = True ;
foreach ( $searchform as $key => $value ) {
$var =! $var ;
print '<tr ' . $bc [ $var ] . '"><td>' . $searchformtitle [ $key ] . '</td><td>' ;
$html -> selectyesnonum ( $searchform [ $key ], $searchformconst [ $key ]);
print '</td></tr>' ;
}
2004-05-17 19:30:54 +02:00
print '</table><br>' ;
2004-08-14 00:10:58 +02:00
2004-02-27 23:44:18 +01:00
print '<div class="tabsAction">' ;
2004-07-31 13:36:01 +02:00
print '<input class="tabAction" type="submit" value="' . $langs -> trans ( " Save " ) . '">' ;
2004-02-27 23:44:18 +01:00
print '</div>' ;
print '</form>' ;
2004-02-13 23:42:47 +01:00
}
else
{
2004-09-04 14:21:59 +02:00
print '<table class="noborder" width="100%">' ;
2004-07-31 13:36:01 +02:00
print '<tr class="liste_titre"><td>' . $langs -> trans ( " Parameter " ) . '</td><td>' . $langs -> trans ( " Value " ) . '</td></tr>' ;
2004-09-04 14:21:59 +02:00
print '<tr class="impair"><td width="50%">' . $langs -> trans ( " Skin " ) . '</td><td>' . MAIN_THEME . '</td></tr>' ;
print '<tr class="pair"><td>' . $langs -> trans ( " MaxSizeList " ) . '</td><td>' . SIZE_LISTE_LIMIT . '</td></tr>' ;
print '<tr class="impair"><td width="50%">' . $langs -> trans ( " MenuTopManager " ) . '</td><td>' ;
2004-05-17 19:30:54 +02:00
$filelib = eregi_replace ( '\.php$' , '' , MAIN_MENU_BARRETOP );
print $filelib ;
print '</td></tr>' ;
2004-09-04 14:21:59 +02:00
print '<tr class="pair"><td width="50%">' . $langs -> trans ( " DefaultLanguage " ) . '</td><td>' . MAIN_LANG_DEFAULT . '</td></tr>' ;
2004-07-26 14:31:16 +02:00
2004-09-04 14:21:59 +02:00
print '<tr class="impair"><td width="50%">' . $langs -> trans ( " MessageOfDay " ) . '</td><td>' . stripslashes ( nl2br ( MAIN_MOTD )) . '</td></tr>' ;
2004-07-26 14:31:16 +02:00
2004-02-13 23:42:47 +01:00
print '</table><br>' ;
2004-08-14 00:10:58 +02:00
// Liste des zone de recherche permanantes support<72> es
2004-09-04 14:21:59 +02:00
print '<table class="noborder" width="100%">' ;
print '<tr class="liste_titre"><td>' . $langs -> trans ( " PermanentLeftSearchForm " ) . '</td><td>' . $langs -> trans ( " Activated " ) . '</td></tr>' ;
2004-08-14 00:10:58 +02:00
$var = True ;
foreach ( $searchform as $key => $value ) {
$var =! $var ;
print '<tr ' . $bc [ $var ] . '"><td>' . $searchformtitle [ $key ] . '</td><td>' . ( $searchformconst [ $key ] ? " oui " : " non " ) . '</td></tr>' ;
}
print '</table><br>' ;
2004-07-26 14:31:16 +02:00
2004-02-13 23:42:47 +01:00
print '<div class="tabsAction">' ;
2004-07-31 13:36:01 +02:00
print '<a class="tabAction" href="ihm.php?action=edit">' . $langs -> trans ( " Edit " ) . '</a>' ;
2004-02-13 23:42:47 +01:00
print '</div>' ;
}
llxFooter ( " <em>Dernière modification $Date $ révision $Revision $ </em> " );
?>