* Copyright (C) 2007 Patrick Raguin * * 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. */ /** \file htdocs/html.formadmin.class.php \brief File of class for html functions for admin pages \version $Id$ */ /** \class FormAdmin \brief Class to generate html code for admin pages */ class FormAdmin { var $db; var $error; /** \brief Constructeur \param DB handler d'acc�s base de donn�e */ function FormAdmin($DB) { $this->db = $DB; return 1; } /** * \brief Retourne la liste déroulante des langues disponibles * \param selected Langue pré-sélectionnée * \param htmlname Nom de la zone select * \param showauto Affiche choix auto */ function select_lang($selected='',$htmlname='lang_id',$showauto=0) { global $langs; $langs_available=$langs->get_available_languages(); print ''; } /** * \brief Retourne la liste d�roulante des menus disponibles (eldy_backoffice, ...) * \param selected Menu pr�-s�lectionn�e * \param htmlname Nom de la zone select * \param dirmenu Rep�rtoire � scanner */ function select_menu($selected='',$htmlname,$dirmenu) { global $langs,$conf; if ($selected == 'eldy.php') $selected='eldy_backoffice.php'; // Pour compatibilit� $menuarray=array(); $handle=opendir($dirmenu); while (($file = readdir($handle))!==false) { if (is_file($dirmenu."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { $filelib=eregi_replace('\.php$','',$file); $prefix=''; if (eregi('^eldy',$file)) $prefix='0'; // Recommanded else if (eregi('^auguria',$file)) $prefix='2'; // Other else if (eregi('^default',$file)) $prefix='2'; // Other else if (eregi('^rodolphe',$file)) $prefix='2'; // Other else if (eregi('^empty',$file)) $prefix='2'; // Other else $prefix='1'; // Experimental if ($file == $selected) { $menuarray[$prefix.'_'.$file]=''; } else { $menuarray[$prefix.'_'.$file]=''; } } } ksort($menuarray); // Affichage liste deroulante des menus print ''; } /** * \brief Retourne la liste d�roulante des menus disponibles (eldy) * \param selected Menu pr�-s�lectionn�e * \param htmlname Nom de la zone select * \param dirmenu Repertoire � scanner */ function select_menu_families($selected='',$htmlname,$dirmenu) { global $langs,$conf; $menuarray=array(); $handle=opendir($dirmenu); while (($file = readdir($handle))!==false) { if (is_file($dirmenu."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { $filelib=eregi_replace('(_backoffice|_frontoffice)?\.php$','',$file); if (eregi('^default',$filelib)) continue; if (eregi('^empty',$filelib)) continue; $menuarray[$filelib]=1; } $menuarray['all']=1; } ksort($menuarray); // Affichage liste deroulante des menus print ''; } /** * \brief Retourne la liste d�roulante des menus disponibles (eldy) * \param selected Menu pr�-s�lectionn�e * \param htmlname Nom de la zone select */ function select_timezone($selected='',$htmlname) { global $langs,$conf; print ''; } /** * \brief Return colors list selector * \param selected Color pre-selected * \param htmlname Name of html select zone */ function select_colors($selected='', $htmlname, $arrayofcolors='', $showcolorbox=1) { global $langs,$conf; if (! is_array($arrayofcolors)) $arrayofcolors=array('29527A','5229A3','A32929','7A367A','B1365F','0D7813'); //$selected=''; if ($showcolorbox) print '
'; print ''; if ($showcolorbox) { print ''; print ''; print ''; print ''; print '
'; print '
'; } } } ?>