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.4 2006-04-28 12:41:49 florian Exp $
|
22 |
// CVS : $Id: HTML_formulaireAuth.class.php,v 1.5 2007-06-26 14:18:53 florian 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.4 $
|
34 |
*@version $Revision: 1.5 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
Line 37... |
Line 37... |
37 |
|
37 |
|
Line 71... |
Line 71... |
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();
|
75 |
$squelette =& $this->defaultRenderer();
|
76 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
76 |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
- |
|
77 |
$squelette->setElementTemplate( '<p class="formulaire_element"><span class="form_label">'."\n".
|
- |
|
78 |
'{label}'."\n".
|
- |
|
79 |
'<!-- BEGIN required --><span style="color:red; width:5px; margin:0; padding:0;">*</span><!-- END required -->'."\n".
|
- |
|
80 |
'</span>'."\n".'{element}'."\n".
|
- |
|
81 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
- |
|
82 |
'</p>'."\n");
|
- |
|
83 |
$squelette->setGroupElementTemplate('<p style="display:inline">{element}</p>', 'form_boutons');
|
- |
|
84 |
$squelette->setRequiredNoteTemplate("\n".'<p class="symbole_obligatoire">* : {requiredNote}</p>'."\n");
|
- |
|
85 |
//Note pour les erreurs javascript
|
- |
|
86 |
$this->setJsWarnings('Erreur de saisie', 'Veuillez verifier vos informations saisies');
|
- |
|
87 |
// Note de fin de formulaire
|
- |
|
88 |
$this->setRequiredNote('Indique les champs obligatoires');
|
- |
|
89 |
// $squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
77 |
$squelette->setElementTemplate( '<li>'."\n".
|
90 |
// $squelette->setElementTemplate( '<li>'."\n".
|
78 |
'{label}'."\n".
|
91 |
// '{label}'."\n".
|
79 |
'{element}'."\n".
|
92 |
// '{element}'."\n".
|
80 |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span><!-- END required -->'."\n".
|
93 |
// '<!-- 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".
|
94 |
// '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
82 |
'</li>'."\n");
|
95 |
// '</li>'."\n");
|
83 |
$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
|
96 |
// $squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
|
84 |
} // end of member function HTML_formulaireProjet
|
97 |
} // end of member function HTML_formulaireProjet
|
Line 85... |
Line 98... |
85 |
|
98 |
|
86 |
/**
|
99 |
/**
|
87 |
* Renvoie le code HTML du formulaire.
|
100 |
* Renvoie le code HTML du formulaire.
|
Line 102... |
Line 115... |
102 |
* @access public
|
115 |
* @access public
|
103 |
*/
|
116 |
*/
|
104 |
function construitFormulaire($url_retour)
|
117 |
function construitFormulaire($url_retour)
|
105 |
{
|
118 |
{
|
106 |
$tab_index = 1000;
|
119 |
$tab_index = 1000;
|
107 |
$size = 60;
|
120 |
$size = 35;
|
108 |
$cols = 50;
|
121 |
$cols = 50;
|
109 |
$rows = 6;
|
122 |
$rows = 6;
|
Line 110... |
Line 123... |
110 |
|
123 |
|
111 |
$form_debut = '<fieldset>'."\n".'<legend>'.ADAU_NOM_FORM.'</legend>'."\n".'<ul>'."\n";
|
124 |
$form_debut = '<fieldset>'."\n".'<legend>'.ADAU_NOM_FORM.'</legend>'."\n";
|
Line 112... |
Line 125... |
112 |
$this->addElement('html', $form_debut);
|
125 |
$this->addElement('html', $form_debut);
|
113 |
|
126 |
|
114 |
$id = 'nom_auth';
|
127 |
$id = 'nom_auth';
|
Line 156... |
Line 169... |
156 |
$id = 'parametres';
|
169 |
$id = 'parametres';
|
157 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => $rows, 'cols' => $cols);
|
170 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => $rows, 'cols' => $cols);
|
158 |
$label = '<label for="'.$id.'">'.ADAU_PARAMETRE.'</label>';
|
171 |
$label = '<label for="'.$id.'">'.ADAU_PARAMETRE.'</label>';
|
159 |
$this->addElement('textarea', $id, $label, $aso_attributs);
|
172 |
$this->addElement('textarea', $id, $label, $aso_attributs);
|
Line 160... |
Line 173... |
160 |
|
173 |
|
161 |
$form_fin = '</ul>'."\n".'</fieldset>'."\n";
|
174 |
$form_fin = "\n".'</fieldset>'."\n";
|
Line 162... |
Line 175... |
162 |
$this->addElement('html', $form_fin);
|
175 |
$this->addElement('html', $form_fin);
|
- |
|
176 |
|
- |
|
177 |
// Gestion des boutons
|
- |
|
178 |
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', ADAU_ANNULER,
|
- |
|
179 |
str_replace ("&", "&", $url_retour->getURL()), ADAU_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
|
- |
|
180 |
// qui remplacent deux fois les & par des &
|
- |
|
181 |
//Bouton de validation du formulaire // ce qui fait échouer le lien
|
- |
|
182 |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAU_VALIDER);
|
- |
|
183 |
$this->addGroup($buttons, 'form_boutons', null, ' ');
|
163 |
|
184 |
|
164 |
// Gestion des boutons
|
185 |
|
165 |
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
|
186 |
// $liste_bouton_debut = '<ul class="liste_bouton">'."\n";
|
166 |
$this->addElement('html', $liste_bouton_debut);
|
187 |
// $this->addElement('html', $liste_bouton_debut);
|
167 |
|
188 |
//
|
168 |
$this->addElement('submit', 'valider', ADAU_VALIDER);
|
189 |
// $this->addElement('submit', 'valider', ADAU_VALIDER);
|
169 |
|
190 |
//
|
170 |
$bouton_annuler = '<li><a class="bouton" href="'.str_replace ('&', '&', $url_retour->getURL()).'">'.ADAU_ANNULER.'</a></li>'."\n";
|
191 |
// $bouton_annuler = '<li><a class="bouton" href="'.str_replace ('&', '&', $url_retour->getURL()).'">'.ADAU_ANNULER.'</a></li>'."\n";
|
171 |
$this->addElement('html', $bouton_annuler);
|
192 |
// $this->addElement('html', $bouton_annuler);
|
172 |
|
193 |
//
|
Line 173... |
Line 194... |
173 |
$liste_bouton_fin = '</ul>'."\n";
|
194 |
// $liste_bouton_fin = '</ul>'."\n";
|
Line 174... |
Line 195... |
174 |
$this->addElement('html', $liste_bouton_fin);
|
195 |
// $this->addElement('html', $liste_bouton_fin);
|