Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU General Public |
|
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 |
|
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 |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: HTML_formulaireAuth.class.php,v 1.2 2004-12-06 12:43:21 alex Exp $
|
22 |
// CVS : $Id: HTML_formulaireAuth.class.php,v 1.3 2005-04-14 13:54:51 jpm Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Application projet
|
24 |
* Application projet
|
25 |
*
|
25 |
*
|
26 |
* La classe HTML_formulaireAuth
|
26 |
* La classe HTML_formulaireAuth
|
27 |
*
|
27 |
*
|
Line 29... |
Line 29... |
29 |
//Auteur original :
|
29 |
//Auteur original :
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
31 |
//Autres auteurs :
|
31 |
//Autres auteurs :
|
32 |
*@author Aucun
|
32 |
*@author Aucun
|
33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@version $Revision: 1.2 $
|
34 |
*@version $Revision: 1.3 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
Line 37... |
Line 37... |
37 |
|
37 |
|
Line 67... |
Line 67... |
67 |
* @param Array attributes Des attributs supplémentaires pour la balise <form>
|
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.
|
68 |
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
|
69 |
* @return void
|
69 |
* @return void
|
70 |
* @access public
|
70 |
* @access public
|
71 |
*/
|
71 |
*/
|
72 |
function HTML_formulaireAuth( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
|
72 |
function HTML_formulaireAuth($formName = '', $method = 'post', $action = '', $target = '_self', $attributes = '', $trackSubmit = false)
|
73 |
{
|
73 |
{
|
74 |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
|
74 |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit);
|
- |
|
75 |
$squelette =& $this->defaultRenderer();
|
- |
|
76 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
- |
|
77 |
$squelette->setElementTemplate( '<li>'."\n".
|
- |
|
78 |
'{label}'."\n".
|
- |
|
79 |
'{element}'."\n".
|
- |
|
80 |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span><!-- END required -->'."\n".
|
- |
|
81 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
- |
|
82 |
'</li>'."\n");
|
- |
|
83 |
$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
|
75 |
} // end of member function HTML_formulaireProjet
|
84 |
} // end of member function HTML_formulaireProjet
|
Line 76... |
Line 85... |
76 |
|
85 |
|
77 |
/**
|
86 |
/**
|
78 |
* Renvoie le code HTML du formulaire.
|
87 |
* Renvoie le code HTML du formulaire.
|
79 |
*
|
88 |
*
|
80 |
* @return string
|
89 |
* @return string
|
81 |
* @access public
|
90 |
* @access public
|
82 |
*/
|
91 |
*/
|
83 |
function toHTML( )
|
92 |
function toHTML()
|
84 |
{
|
93 |
{
|
85 |
$res = HTML_QuickForm::toHTML() ;
|
94 |
$res = HTML_QuickForm::toHTML();
|
86 |
return $res ;
|
95 |
return $res;
|
Line 87... |
Line 96... |
87 |
} // end of member function toHTML
|
96 |
} // end of member function toHTML
|
88 |
|
97 |
|
89 |
/**
|
98 |
/**
|
90 |
* Ajoute les champs nécessaire au formulaire.
|
99 |
* Ajoute les champs nécessaire au formulaire.
|
91 |
*
|
100 |
*
|
92 |
* @return void
|
101 |
* @return void
|
93 |
* @access public
|
102 |
* @access public
|
94 |
*/
|
103 |
*/
|
- |
|
104 |
function construitFormulaire($url_retour)
|
- |
|
105 |
{
|
- |
|
106 |
$tab_index = 1000;
|
- |
|
107 |
$size = 60;
|
- |
|
108 |
$cols = 50;
|
- |
|
109 |
$rows = 6;
|
- |
|
110 |
|
- |
|
111 |
$form_debut = '<fieldset>'."\n".'<legend>'.ADAU_NOM_FORM.'</legend>'."\n".'<ul>'."\n";
|
- |
|
112 |
$this->addElement('html', $form_debut);
|
- |
|
113 |
|
- |
|
114 |
$id = 'nom_auth';
|
95 |
function construitFormulaire($url_retour)
|
115 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
96 |
{
|
116 |
$label = '<label for="'.$id.'">'.ADAU_NOM_AUTH.'</label>';
|
- |
|
117 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
118 |
$this->addRule('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client');
|
- |
|
119 |
|
- |
|
120 |
$id = 'abreviation';
|
- |
|
121 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
- |
|
122 |
$label = '<label for="'.$id.'">'.ADAU_ABREVIATION.'</label>';
|
- |
|
123 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
124 |
$this->addRule('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client');
|
- |
|
125 |
|
- |
|
126 |
$id = 'dsn';
|
- |
|
127 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
- |
|
128 |
$label = '<label for="'.$id.'">'.ADAU_DSN.'</label>';
|
- |
|
129 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
130 |
$this->addRule('dsn', ADAU_DSN_ALERTE, 'required', '', 'client');
|
- |
|
131 |
|
- |
|
132 |
$id = 'nom_table';
|
- |
|
133 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
- |
|
134 |
$label = '<label for="'.$id.'">'.ADAU_NOM_TABLE.'</label>';
|
- |
|
135 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
136 |
$this->addRule('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client');
|
- |
|
137 |
|
- |
|
138 |
$id = 'champs_login';
|
- |
|
139 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
- |
|
140 |
$label = '<label for="'.$id.'">'.ADAU_CHAMPS_LOGIN.'</label>';
|
- |
|
141 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
142 |
$this->addRule('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client');
|
- |
|
143 |
|
- |
|
144 |
$id = 'champs_passe';
|
- |
|
145 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
- |
|
146 |
$label = '<label for="'.$id.'">'.ADAU_CHAMPS_PASSE.'</label>';
|
- |
|
147 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
148 |
$this->addRule('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client');
|
- |
|
149 |
|
- |
|
150 |
$id = 'cryptage';
|
- |
|
151 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
|
- |
|
152 |
$label = '<label for="'.$id.'">'.ADAU_CRYPTAGE.'</label>';
|
- |
|
153 |
$this->addElement('text', $id, $label, $aso_attributs);
|
- |
|
154 |
$this->addRule('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client');
|
- |
|
155 |
|
- |
|
156 |
$id = 'parametres';
|
- |
|
157 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => $rows, 'cols' => $cols);
|
- |
|
158 |
$label = '<label for="'.$id.'">'.ADAU_PARAMETRE.'</label>';
|
- |
|
159 |
$this->addElement('textarea', $id, $label, $aso_attributs);
|
- |
|
160 |
|
- |
|
161 |
$form_fin = '</ul>'."\n".'</fieldset>'."\n";
|
- |
|
162 |
$this->addElement('html', $form_fin);
|
- |
|
163 |
|
- |
|
164 |
// Gestion des boutons
|
- |
|
165 |
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
|
- |
|
166 |
$this->addElement('html', $liste_bouton_debut);
|
Line -... |
Line 167... |
- |
|
167 |
|
- |
|
168 |
$this->addElement('submit', 'valider', ADAU_VALIDER);
|
Line 97... |
Line 169... |
97 |
$this->addElement ('text', 'nom_auth', ADAU_NOM_AUTH, array ('size' => 60)) ;
|
169 |
|
98 |
$this->addRule ('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client') ;
|
170 |
$bouton_annuler = '<li><a class="bouton" href="'.str_replace ('&', '&', $url_retour->getURL()).'">'.ADAU_ANNULER.'</a></li>'."\n";
|
Line 99... |
Line -... |
99 |
|
- |
|
100 |
|
- |
|
Line -... |
Line 171... |
- |
|
171 |
$this->addElement('html', $bouton_annuler);
|
Line 101... |
Line -... |
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 |
|
- |
|
123 |
$this->addElement ('text', 'parametres', ADAU_PARAMETRE) ;
|
172 |
|
Line 124... |
Line 173... |
124 |
|
173 |
$liste_bouton_fin = '</ul>'."\n";
|
125 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAU_CHAMPS_REQUIS) ;
|
174 |
$this->addElement('html', $liste_bouton_fin);
|