1 |
<?php
|
1 |
<?php
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
4 |
// | PHP version 4.1 |
|
4 |
// | PHP version 4.1 |
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
8 |
// | This library is free software; you can redistribute it and/or |
|
8 |
// | This library is free software; you can redistribute it and/or |
|
9 |
// | modify it under the terms of the GNU General Public |
|
9 |
// | modify it under the terms of the GNU General Public |
|
10 |
// | License as published by the Free Software Foundation; either |
|
10 |
// | License as published by the Free Software Foundation; either |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
12 |
// | |
|
12 |
// | |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
// | General Public License for more details. |
|
16 |
// | General Public License for more details. |
|
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_formulaireCreationWikini.class.php,v 1.1 2005-09-22 14:02:48 ddelon Exp $
|
22 |
// CVS : $Id: HTML_formulaireCreationWikini.class.php,v 1.2 2005-09-27 16:39:47 alexandre_tb Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Application projet
|
24 |
* Application projet
|
25 |
*
|
25 |
*
|
26 |
* La classe HTML_formulaireCreationWikini
|
26 |
* La classe HTML_formulaireCreationWikini
|
27 |
*
|
27 |
*
|
28 |
*@package projet
|
28 |
*@package projet
|
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.1 $
|
34 |
*@version $Revision: 1.2 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
37 |
|
37 |
|
38 |
|
38 |
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// | ENTETE du PROGRAMME |
|
40 |
// | ENTETE du PROGRAMME |
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
|
42 |
|
43 |
|
43 |
|
44 |
/**
|
44 |
/**
|
45 |
* class HTML_formulaireCreationWikini
|
45 |
* class HTML_formulaireCreationWikini
|
46 |
*
|
46 |
*
|
47 |
*/
|
47 |
*/
|
48 |
class HTML_formulaireCreationWikini extends HTML_QuickForm
|
48 |
class HTML_formulaireCreationWikini extends HTML_QuickForm
|
49 |
{
|
49 |
{
|
50 |
|
50 |
|
51 |
/*** Attributes: ***/
|
51 |
/*** Attributes: ***/
|
52 |
|
52 |
|
53 |
/**
|
53 |
/**
|
54 |
* Constructeur
|
54 |
* Constructeur
|
55 |
*
|
55 |
*
|
56 |
* @return void
|
56 |
* @return void
|
57 |
* @access public
|
57 |
* @access public
|
58 |
*/
|
58 |
*/
|
59 |
function HTML_formulaireCreationWikini($formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false)
|
59 |
function HTML_formulaireCreationWikini($formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false)
|
60 |
{
|
60 |
{
|
61 |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
|
61 |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
|
62 |
} // end of member function HTML_formulaireCreationWikini
|
62 |
} // end of member function HTML_formulaireCreationWikini
|
63 |
|
63 |
|
64 |
/**
|
64 |
/**
|
65 |
*
|
65 |
*
|
66 |
*
|
66 |
*
|
67 |
* @return void
|
67 |
* @return void
|
68 |
* @access public
|
68 |
* @access public
|
69 |
*/
|
69 |
*/
|
70 |
function construitFormulaire( )
|
70 |
function construitFormulaire( )
|
71 |
{
|
71 |
{
|
72 |
|
72 |
|
73 |
$this->addElement ('html', '<p>'.PROJET_WIKINI_NOM_EXPLICATION.'</p>') ;
|
73 |
$this->addElement ('html', '<p>'.PROJET_WIKINI_NOM_EXPLICATION.'</p>') ;
|
74 |
$this->addElement ('text', 'nom_wikini', PROJET_WIKINI_CHOISIR_NOM) ;
|
74 |
$this->addElement ('text', 'nom_wikini', PROJET_WIKINI_CHOISIR_NOM) ;
|
75 |
$this->addRule ('nom_wikini', PROJET_NOM_WIKINI_REQUIS, 'required', '', 'client') ;
|
75 |
$this->addRule ('nom_wikini', PROJET_NOM_WIKINI_REQUIS, 'required', '', 'client') ;
|
76 |
$this->addRule ('nom_wikini', PROJET_WIKINI_NOM_INVALIDE, 'regex', '/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/', 'client') ;
|
76 |
$this->addRule ('nom_wikini', PROJET_WIKINI_NOM_INVALIDE, 'regex', '/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/', 'client') ;
|
77 |
|
77 |
|
78 |
/*
|
78 |
/*
|
79 |
$this->addElement ('text', 'prefixe_wikini', PROJET_PREFIXE_WIKINI) ;
|
79 |
$this->addElement ('text', 'prefixe_wikini', PROJET_PREFIXE_WIKINI) ;
|
80 |
$this->addRule ('prefixe_wikini', PROJET_PREFIXE_WIKINI_REQUIS, 'required', '', 'client');
|
80 |
$this->addRule ('prefixe_wikini', PROJET_PREFIXE_WIKINI_REQUIS, 'required', '', 'client');
|
81 |
*/
|
81 |
*/
|
82 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
|
82 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
|
83 |
$url_annuler = new Net_URL($this->getAttribute('action')) ;
|
83 |
$url_annuler = new Net_URL($this->getAttribute('action')) ;
|
84 |
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
|
84 |
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
|
85 |
|
85 |
|
86 |
// on fait un groupe avec les boutons pour les mettres sur la même ligne
|
86 |
// on fait un groupe avec les boutons pour les mettres sur la même ligne
|
87 |
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
|
87 |
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
|
88 |
preg_replace ("/&/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
|
88 |
preg_replace ("/&/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
|
89 |
// qui remplacent deux fois les & par des &
|
89 |
// qui remplacent deux fois les & par des &
|
90 |
// ce qui fait échouer le lien
|
90 |
// ce qui fait échouer le lien
|
91 |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
|
91 |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
|
92 |
$this->addGroup($buttons, null, null, ' ');
|
92 |
$this->addGroup($buttons, null, null, ' ');
|
93 |
} // end of member function construitFormulaire
|
93 |
} // end of member function construitFormulaire
|
94 |
|
94 |
|
95 |
/**
|
95 |
/**
|
96 |
* Renvoie le code HTML du formulaire.
|
96 |
* Renvoie le code HTML du formulaire.
|
97 |
*
|
97 |
*
|
98 |
* @return string
|
98 |
* @return string
|
99 |
* @access public
|
99 |
* @access public
|
100 |
*/
|
100 |
*/
|
101 |
function toHTML( )
|
101 |
function toHTML( )
|
102 |
{
|
102 |
{
|
103 |
$res = HTML_QuickForm::toHTML() ;
|
103 |
$res = HTML_QuickForm::toHTML() ;
|
104 |
return $res ;
|
104 |
return $res ;
|
105 |
} // end of member function toHTML
|
105 |
} // end of member function toHTML
|
106 |
|
106 |
|
107 |
} // end of HTML_formulaireCreationWikini
|
107 |
} // end of HTML_formulaireCreationWikini
|
108 |
?>
|
108 |
?>
|