Rev 206 | Rev 832 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*vim: set expandtab tabstop=4 shiftwidth=4: */// +------------------------------------------------------------------------------------------------------+// | PHP version 4.1 |// +------------------------------------------------------------------------------------------------------+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |// +------------------------------------------------------------------------------------------------------+// | This library 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.1 of the License, or (at your option) any later version. |// | |// | This library 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 library; if not, write to the Free Software |// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |// +------------------------------------------------------------------------------------------------------+// CVS : $Id: HTML_formulaireAuth.class.php,v 1.2 2004-12-06 12:43:21 alex Exp $/*** Application projet** La classe HTML_formulaireAuth**@package projet//Auteur original :*@author Alexandre Granier <alexandre@tela-botanica.org>//Autres auteurs :*@author Aucun*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.2 $// +------------------------------------------------------------------------------------------------------+*/// +------------------------------------------------------------------------------------------------------+// | ENTETE du PROGRAMME |// +------------------------------------------------------------------------------------------------------+/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */require_once 'HTML/QuickForm.php' ;require_once 'HTML/QuickForm/checkbox.php' ;require_once 'HTML/QuickForm/select.php' ;// +------------------------------------------------------------------------------------------------------+// | LISTE des constantes |// +------------------------------------------------------------------------------------------------------+/*** class HTML_formulaireProjet* Cette classe représente un formulaire pour saisir un projet ou le modifier.*/class HTML_formulaireAuth extends HTML_QuickForm{/*** Constructeur** @param string formName Le nom du formulaire.* @param string method Soit get soit post, voir le protocole HTTP* @param string action L'action du formulaire.* @param string target La cible du formulaire.* @param Array attributes Des attributs supplémentaires pour la balise <form>* @param bool trackSubmit Pour repérer si la formulaire a été soumis.* @return void* @access public*/function HTML_formulaireAuth( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false ){HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;} // end of member function HTML_formulaireProjet/*** Renvoie le code HTML du formulaire.** @return string* @access public*/function toHTML( ){$res = HTML_QuickForm::toHTML() ;return $res ;} // end of member function toHTML/*** Ajoute les champs nécessaire au formulaire.** @return void* @access public*/function construitFormulaire($url_retour){$this->addElement ('text', 'nom_auth', ADAU_NOM_AUTH, array ('size' => 60)) ;$this->addRule ('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'abreviation', ADAU_ABREVIATION) ;$this->addRule ('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'dsn', ADAU_DSN) ;$this->addRule ('dsn', ADAU_DSN_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'nom_table', ADAU_NOM_TABLE) ;$this->addRule ('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'champs_login', ADAU_CHAMPS_LOGIN) ;$this->addRule ('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'champs_passe', ADAU_CHAMPS_PASSE) ;$this->addRule ('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'cryptage', ADAU_CRYPTAGE) ;$this->addRule ('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client') ;$this->addElement ('text', 'parametres', ADAU_PARAMETRE) ;$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAU_CHAMPS_REQUIS) ;// on fait un groupe avec les boutons pour les mettres sur la même ligne$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAU_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&', '&', $url_retour->getURL())."'"));$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAU_VALIDER);$this->addGroup($buttons, null, null, ' ');} // end of member function _construitFormulaire} // end of HTML_formulaireProjet?>