206 |
alex |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
18 |
// | You should have received a copy of the GNU General Public |
|
|
|
19 |
// | License along with this library; if not, write to the Free Software |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
209 |
alex |
22 |
// CVS : $Id: HTML_formulaireAuth.class.php,v 1.2 2004-12-06 12:43:21 alex Exp $
|
206 |
alex |
23 |
/**
|
|
|
24 |
* Application projet
|
|
|
25 |
*
|
|
|
26 |
* La classe HTML_formulaireAuth
|
|
|
27 |
*
|
|
|
28 |
*@package projet
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
|
|
31 |
//Autres auteurs :
|
|
|
32 |
*@author Aucun
|
|
|
33 |
*@copyright Tela-Botanica 2000-2004
|
209 |
alex |
34 |
*@version $Revision: 1.2 $
|
206 |
alex |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
// | ENTETE du PROGRAMME |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
|
|
|
43 |
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
|
|
|
44 |
|
|
|
45 |
require_once 'HTML/QuickForm.php' ;
|
|
|
46 |
require_once 'HTML/QuickForm/checkbox.php' ;
|
|
|
47 |
require_once 'HTML/QuickForm/select.php' ;
|
|
|
48 |
|
|
|
49 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
50 |
// | LISTE des constantes |
|
|
|
51 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
/**
|
|
|
55 |
* class HTML_formulaireProjet
|
|
|
56 |
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
|
|
|
57 |
*/
|
|
|
58 |
class HTML_formulaireAuth extends HTML_QuickForm
|
|
|
59 |
{
|
|
|
60 |
/**
|
|
|
61 |
* Constructeur
|
|
|
62 |
*
|
|
|
63 |
* @param string formName Le nom du formulaire.
|
|
|
64 |
* @param string method Soit get soit post, voir le protocole HTTP
|
|
|
65 |
* @param string action L'action du formulaire.
|
|
|
66 |
* @param string target La cible du formulaire.
|
|
|
67 |
* @param Array attributes Des attributs supplémentaires pour la balise <form>
|
|
|
68 |
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
|
|
|
69 |
* @return void
|
|
|
70 |
* @access public
|
|
|
71 |
*/
|
|
|
72 |
function HTML_formulaireAuth( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
|
|
|
73 |
{
|
|
|
74 |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
|
|
|
75 |
} // end of member function HTML_formulaireProjet
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* Renvoie le code HTML du formulaire.
|
|
|
79 |
*
|
|
|
80 |
* @return string
|
|
|
81 |
* @access public
|
|
|
82 |
*/
|
|
|
83 |
function toHTML( )
|
|
|
84 |
{
|
|
|
85 |
$res = HTML_QuickForm::toHTML() ;
|
|
|
86 |
return $res ;
|
|
|
87 |
} // end of member function toHTML
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
* Ajoute les champs nécessaire au formulaire.
|
|
|
91 |
*
|
|
|
92 |
* @return void
|
|
|
93 |
* @access public
|
|
|
94 |
*/
|
|
|
95 |
function construitFormulaire($url_retour)
|
|
|
96 |
{
|
|
|
97 |
$this->addElement ('text', 'nom_auth', ADAU_NOM_AUTH, array ('size' => 60)) ;
|
|
|
98 |
$this->addRule ('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client') ;
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
$this->addElement ('text', 'abreviation', ADAU_ABREVIATION) ;
|
|
|
102 |
$this->addRule ('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client') ;
|
|
|
103 |
|
|
|
104 |
$this->addElement ('text', 'dsn', ADAU_DSN) ;
|
|
|
105 |
$this->addRule ('dsn', ADAU_DSN_ALERTE, 'required', '', 'client') ;
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
$this->addElement ('text', 'nom_table', ADAU_NOM_TABLE) ;
|
|
|
109 |
$this->addRule ('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client') ;
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
$this->addElement ('text', 'champs_login', ADAU_CHAMPS_LOGIN) ;
|
|
|
113 |
$this->addRule ('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client') ;
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
$this->addElement ('text', 'champs_passe', ADAU_CHAMPS_PASSE) ;
|
|
|
117 |
$this->addRule ('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client') ;
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
$this->addElement ('text', 'cryptage', ADAU_CRYPTAGE) ;
|
|
|
121 |
$this->addRule ('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client') ;
|
|
|
122 |
|
209 |
alex |
123 |
$this->addElement ('text', 'parametres', ADAU_PARAMETRE) ;
|
|
|
124 |
|
206 |
alex |
125 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAU_CHAMPS_REQUIS) ;
|
|
|
126 |
// on fait un groupe avec les boutons pour les mettres sur la même ligne
|
|
|
127 |
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAU_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&', '&', $url_retour->getURL())."'"));
|
|
|
128 |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAU_VALIDER);
|
|
|
129 |
$this->addGroup($buttons, null, null, ' ');
|
|
|
130 |
} // end of member function _construitFormulaire
|
|
|
131 |
|
|
|
132 |
} // end of HTML_formulaireProjet
|
|
|
133 |
?>
|