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_formulaireAppli.class.php,v 1.3 2006-04-28 12:41:49 florian Exp $
|
22 |
// CVS : $Id: HTML_formulaireAppli.class.php,v 1.4 2006-12-01 10:39:14 alexandre_tb Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Application projet
|
24 |
* Application projet
|
25 |
*
|
25 |
*
|
26 |
* La classe HTML_formulaireAuth
|
26 |
* La classe HTML_formulaireAuth
|
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.3 $
|
34 |
*@version $Revision: 1.4 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
37 |
|
37 |
|
38 |
|
38 |
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// | ENTETE du PROGRAMME |
|
40 |
// | ENTETE du PROGRAMME |
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
|
42 |
|
43 |
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
|
43 |
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
|
44 |
|
44 |
|
45 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
|
45 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
|
46 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
|
46 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
|
47 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php' ;
|
47 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php' ;
|
48 |
|
48 |
|
49 |
// +------------------------------------------------------------------------------------------------------+
|
49 |
// +------------------------------------------------------------------------------------------------------+
|
50 |
// | LISTE des constantes |
|
50 |
// | LISTE des constantes |
|
51 |
// +------------------------------------------------------------------------------------------------------+
|
51 |
// +------------------------------------------------------------------------------------------------------+
|
52 |
|
52 |
|
53 |
|
53 |
|
54 |
/**
|
54 |
/**
|
55 |
* class HTML_formulaireProjet
|
55 |
* class HTML_formulaireProjet
|
56 |
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
|
56 |
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
|
57 |
*/
|
57 |
*/
|
58 |
class HTML_formulaireAppl extends HTML_QuickForm
|
58 |
class HTML_formulaireAppl extends HTML_QuickForm
|
59 |
{
|
59 |
{
|
60 |
/**
|
60 |
/**
|
61 |
* Constructeur
|
61 |
* Constructeur
|
62 |
*
|
62 |
*
|
63 |
* @param string formName Le nom du formulaire.
|
63 |
* @param string formName Le nom du formulaire.
|
64 |
* @param string method Soit get soit post, voir le protocole HTTP
|
64 |
* @param string method Soit get soit post, voir le protocole HTTP
|
65 |
* @param string action L'action du formulaire.
|
65 |
* @param string action L'action du formulaire.
|
66 |
* @param string target La cible du formulaire.
|
66 |
* @param string target La cible du formulaire.
|
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_formulaireAppl( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
|
72 |
function HTML_formulaireAppl( $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 |
} // end of member function HTML_formulaireProjet
|
75 |
} // end of member function HTML_formulaireProjet
|
76 |
|
76 |
|
77 |
/**
|
77 |
/**
|
78 |
* Renvoie le code HTML du formulaire.
|
78 |
* Renvoie le code HTML du formulaire.
|
79 |
*
|
79 |
*
|
80 |
* @return string
|
80 |
* @return string
|
81 |
* @access public
|
81 |
* @access public
|
82 |
*/
|
82 |
*/
|
83 |
function toHTML( )
|
83 |
function toHTML( )
|
84 |
{
|
84 |
{
|
85 |
$res = HTML_QuickForm::toHTML() ;
|
85 |
$res = HTML_QuickForm::toHTML() ;
|
86 |
return $res ;
|
86 |
return $res ;
|
87 |
} // end of member function toHTML
|
87 |
} // end of member function toHTML
|
88 |
|
88 |
|
89 |
/**
|
89 |
/**
|
90 |
* Ajoute les champs nécessaire au formulaire.
|
90 |
* Ajoute les champs nécessaire au formulaire.
|
91 |
*
|
91 |
*
|
92 |
* @return void
|
92 |
* @return void
|
93 |
* @access public
|
93 |
* @access public
|
94 |
*/
|
94 |
*/
|
95 |
function construitFormulaire($url_retour)
|
95 |
function construitFormulaire($url_retour)
|
96 |
{
|
96 |
{
|
97 |
$this->addElement ('text', 'nom_appl', ADAP_NOM_APPL, array ('size' => 60)) ;
|
97 |
$this->addElement ('text', 'nom_appl', ADAP_NOM_APPL, array ('size' => 60)) ;
|
98 |
$this->addRule ('nom_appl', ADAP_NOM_APPL_ALERTE, 'required', '', 'client') ;
|
98 |
$this->addRule ('nom_appl', ADAP_NOM_APPL_ALERTE, 'required', '', 'client') ;
|
99 |
|
99 |
|
100 |
$this->addElement ('textarea', 'description', ADAP_DESCRIPTION, array ('cols' => 50, 'rows' => 5)) ;
|
100 |
$this->addElement ('textarea', 'description', ADAP_DESCRIPTION, array ('cols' => 50, 'rows' => 5)) ;
|
101 |
$this->addElement ('text', 'chemin', ADAP_CHEMIN, array('size' => 50)) ;
|
101 |
$this->addElement ('text', 'chemin', ADAP_CHEMIN, array('size' => 50)) ;
|
102 |
$this->addElement ('checkbox', 'applette', ADAP_APPLETTE, '', 0) ;
|
- |
|
103 |
|
102 |
|
104 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAP_CHAMPS_REQUIS) ;
|
103 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAP_CHAMPS_REQUIS) ;
|
105 |
// on fait un groupe avec les boutons pour les mettres sur la même ligne
|
104 |
// on fait un groupe avec les boutons pour les mettres sur la même ligne
|
106 |
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAP_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&', '&', $url_retour->getURL())."'"));
|
105 |
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAP_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&', '&', $url_retour->getURL())."'"));
|
107 |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAP_VALIDER);
|
106 |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAP_VALIDER);
|
108 |
$this->addGroup($buttons, null, null, ' ');
|
107 |
$this->addGroup($buttons, null, null, ' ');
|
109 |
} // end of member function _construitFormulaire
|
108 |
} // end of member function _construitFormulaire
|
110 |
} // end of HTML_formulaireProjet
|
109 |
} // end of HTML_formulaireProjet
|
111 |
?>
|
110 |
?>
|