Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser 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: inscription.class.php,v 1.2 2004-12-17 17:41:57 alex Exp $
|
22 |
// CVS : $Id: inscription.class.php,v 1.3 2005-03-02 12:46:40 alex Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Inscription
|
24 |
* Inscription
|
25 |
*
|
25 |
*
|
26 |
* Un module d'inscription, en général ce code est spécifique à
|
26 |
* Un module d'inscription, en général ce code est spécifique à
|
27 |
* un site web
|
27 |
* un site web
|
Line 29... |
Line 29... |
29 |
*@package inscription
|
29 |
*@package inscription
|
30 |
//Auteur original :
|
30 |
//Auteur original :
|
31 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
31 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
32 |
//Autres auteurs :
|
32 |
//Autres auteurs :
|
33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@version $Revision: 1.2 $ $Date: 2004-12-17 17:41:57 $
|
34 |
*@version $Revision: 1.3 $ $Date: 2005-03-02 12:46:40 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
Line 37... |
Line 37... |
37 |
|
37 |
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
Line 69... |
Line 69... |
69 |
*/
|
69 |
*/
|
70 |
function construitFormulaire($url, $liste_pays)
|
70 |
function construitFormulaire($url, $liste_pays)
|
71 |
{
|
71 |
{
|
72 |
$squelette =& $this->defaultRenderer();
|
72 |
$squelette =& $this->defaultRenderer();
|
73 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
73 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
74 |
$squelette->setElementTemplate( '<li class="liste_inscription">'."\n".'{label}'."\n".'{element}'."\n".
|
74 |
$squelette->setElementTemplate( '<li class="liste_inscription">'."\n".'<label>{label}</label>'."\n".'{element}'."\n".
|
75 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
75 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
|
76 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
76 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
|
77 |
'</li>'."\n");
|
77 |
'</li>'."\n");
|
78 |
$squelette->setGroupElementTemplate ('<span class="groupe_formulaire">{label}{element}</span>', 'groupe_mot_de_passe') ;
|
- |
|
- |
|
78 |
|
79 |
$squelette->setGroupElementTemplate ('<span class="groupe_formulaire">{label}{element}</span>', 'groupe_cp_ville') ;
|
79 |
$squelette->setGroupElementTemplate ('<span class="groupe_formulaire"><label>{label}</label> {element}</span>', 'groupe_cp_ville') ;
|
80 |
$squelette->setGroupElementTemplate ('<span class="groupe_formulaire">{label}{element}</span>', 'groupe_nom') ;
|
80 |
$squelette->setGroupElementTemplate ('<span class="groupe_formulaire"><label>{label}</label> {element}</span>', 'groupe_nom') ;
|
81 |
$squelette->setRequiredNoteTemplate("\n".'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'."\n");
|
81 |
$squelette->setRequiredNoteTemplate("\n".'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'."\n");
|
Line 82... |
Line 82... |
82 |
|
82 |
|
83 |
$fieldset_debut = '<fieldset>'."\n".
|
83 |
$fieldset_debut = '<fieldset>'."\n".
|
84 |
'<legend>'.INS_AJOUT_MEMBRE.'</legend>'."\n".
|
84 |
'<legend>'.INS_AJOUT_MEMBRE.'</legend>'."\n".
|
Line 90... |
Line 90... |
90 |
$this->registerRule('doublonmail', 'callback', 'verif_doublonMail');
|
90 |
$this->registerRule('doublonmail', 'callback', 'verif_doublonMail');
|
91 |
$this->addRule('email', INS_MAIL_DOUBLE, 'doublonmail', true);
|
91 |
$this->addRule('email', INS_MAIL_DOUBLE, 'doublonmail', true);
|
Line 92... |
Line 92... |
92 |
|
92 |
|
93 |
|
93 |
|
94 |
// A faire, grouper les mots de passe
|
94 |
// A faire, grouper les mots de passe
|
95 |
$this->addElement ('password', 'mot_de_passe', INS_MOT_DE_PASSE) ;
|
95 |
$this->addElement ('password', 'mot_de_passe', INS_MOT_DE_PASSE, array ('size' => '8')) ;
|
96 |
$this->addElement ('password', 'mot_de_passe_repete', INS_REPETE_MOT_DE_PASSE) ;
|
96 |
$this->addElement ('password', 'mot_de_passe_repete', INS_REPETE_MOT_DE_PASSE, array ('size' => '8')) ;
|
97 |
$this->addRule ('mot_de_passe', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
|
97 |
$this->addRule ('mot_de_passe', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
|
Line 98... |
Line 98... |
98 |
$this->addRule ('mot_de_passe_repete', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
|
98 |
$this->addRule ('mot_de_passe_repete', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
|
99 |
$this->addRule (array ('mot_de_passe', 'mot_de_passe_repete'), INS_MOTS_DE_PASSE_DIFFERENTS, 'compare', '', 'client') ;
|
99 |
$this->addRule (array ('mot_de_passe', 'mot_de_passe_repete'), INS_MOTS_DE_PASSE_DIFFERENTS, 'compare', '', 'client') ;
|
100 |
|
100 |
|
Line 101... |
Line 101... |
101 |
|
101 |
|
102 |
$nom_prenom[] = & HTML_QuickForm::createElement ('text', 'nom', INS_NOM) ;
|
102 |
$nom_prenom[] = & HTML_QuickForm::createElement ('text', 'nom', INS_NOM, array ('size' => '12')) ;
|
103 |
$nom_prenom[] = & HTML_QuickForm::createElement ('text', 'prenom', INS_PRENOM) ;
|
103 |
$nom_prenom[] = & HTML_QuickForm::createElement ('text', 'prenom', INS_PRENOM, array ('size' => '12')) ;
|
104 |
$this->addGroup ($nom_prenom, 'groupe_nom', '', '', false) ;
|
104 |
$this->addGroup ($nom_prenom, 'groupe_nom', '', '', false) ;
|
105 |
|
105 |
|
106 |
if (INS_UTILISE_WIKINI) {
|
106 |
if (INS_UTILISE_WIKINI) {
|
107 |
$this->addElement ('text', 'nom_wikini', INS_NOM_WIKI) ;
|
107 |
$this->addElement ('text', 'nom_wikini', INS_NOM_WIKI, array ('size' => '12')) ;
|
108 |
$this->addRule ('nom_wikini', INS_MAUVAIS_NOM_WIKI, 'regex', '/(!?[A-Z][A-Za-z0-9]*[a-z0-9]+[A-Z][A-Za-z0-9]*)/', 'client') ;
|
108 |
$this->addRule ('nom_wikini', INS_MAUVAIS_NOM_WIKI, 'regex', '/(!?[A-Z][A-Za-z0-9]*[a-z0-9]+[A-Z][A-Za-z0-9]*)/', 'client') ;
|
109 |
$this->registerRule('doublonwikini', 'callback', 'verif_doublonNomWiki');
|
109 |
$this->registerRule('doublonwikini', 'callback', 'verif_doublonNomWiki');
|
110 |
$this->addRule('nom_wikini', INS_NOMWIKI_DOUBLE, 'doublonwikini', true);
|
110 |
$this->addRule('nom_wikini', INS_NOMWIKI_DOUBLE, 'doublonwikini', true);
|
111 |
}
|
111 |
}
|
Line 112... |
Line 112... |
112 |
$this->addElement ('text', 'adresse_1', INS_ADRESSE) ;
|
112 |
$this->addElement ('text', 'adresse_1', INS_ADRESSE) ;
|
113 |
$this->addElement ('text', 'adresse_2', INS_ADRESSE) ;
|
113 |
$this->addElement ('text', 'adresse_2', INS_ADRESSE) ;
|
114 |
if (INS_CHAMPS_TELEPHONE) $this->addElement('text', 'telephone', INS_TELEPHONE) ;
|
114 |
if (INS_CHAMPS_TELEPHONE) $this->addElement('text', 'telephone', INS_TELEPHONE, array ('size' => '12')) ;
|
115 |
if (INS_CHAMPS_FAX) $this->addElement('text', 'fax', INS_FAX) ;
|
115 |
if (INS_CHAMPS_FAX) $this->addElement('text', 'fax', INS_FAX, array ('size' => '12')) ;
|
Line 116... |
Line 116... |
116 |
$this->addElement ('text', 'region', INS_REGION) ;
|
116 |
$this->addElement ('text', 'region', INS_REGION) ;
|