229 |
alex |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
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 |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
832 |
florian |
22 |
// CVS : $Id: HTML_formulaireAppli.class.php,v 1.3 2006-04-28 12:41:49 florian Exp $
|
229 |
alex |
23 |
/**
|
|
|
24 |
* Application projet
|
|
|
25 |
*
|
|
|
26 |
* La classe HTML_formulaireAuth
|
|
|
27 |
*
|
|
|
28 |
*@package projet
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
|
|
31 |
//Autres auteurs :
|
|
|
32 |
*@author Aucun
|
|
|
33 |
*@copyright Tela-Botanica 2000-2004
|
832 |
florian |
34 |
*@version $Revision: 1.3 $
|
229 |
alex |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
// | ENTETE du PROGRAMME |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
|
|
|
43 |
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
|
|
|
44 |
|
832 |
florian |
45 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
|
|
|
46 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
|
|
|
47 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php' ;
|
229 |
alex |
48 |
|
|
|
49 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
50 |
// | LISTE des constantes |
|
|
|
51 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
/**
|
|
|
55 |
* class HTML_formulaireProjet
|
|
|
56 |
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
|
|
|
57 |
*/
|
300 |
alex |
58 |
class HTML_formulaireAppl extends HTML_QuickForm
|
229 |
alex |
59 |
{
|
|
|
60 |
/**
|
|
|
61 |
* Constructeur
|
|
|
62 |
*
|
|
|
63 |
* @param string formName Le nom du formulaire.
|
|
|
64 |
* @param string method Soit get soit post, voir le protocole HTTP
|
|
|
65 |
* @param string action L'action du formulaire.
|
|
|
66 |
* @param string target La cible du formulaire.
|
|
|
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.
|
|
|
69 |
* @return void
|
|
|
70 |
* @access public
|
|
|
71 |
*/
|
300 |
alex |
72 |
function HTML_formulaireAppl( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
|
229 |
alex |
73 |
{
|
|
|
74 |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
|
|
|
75 |
} // end of member function HTML_formulaireProjet
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* Renvoie le code HTML du formulaire.
|
|
|
79 |
*
|
|
|
80 |
* @return string
|
|
|
81 |
* @access public
|
|
|
82 |
*/
|
|
|
83 |
function toHTML( )
|
|
|
84 |
{
|
|
|
85 |
$res = HTML_QuickForm::toHTML() ;
|
|
|
86 |
return $res ;
|
|
|
87 |
} // end of member function toHTML
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
* Ajoute les champs nécessaire au formulaire.
|
|
|
91 |
*
|
|
|
92 |
* @return void
|
|
|
93 |
* @access public
|
|
|
94 |
*/
|
|
|
95 |
function construitFormulaire($url_retour)
|
|
|
96 |
{
|
300 |
alex |
97 |
$this->addElement ('text', 'nom_appl', ADAP_NOM_APPL, array ('size' => 60)) ;
|
|
|
98 |
$this->addRule ('nom_appl', ADAP_NOM_APPL_ALERTE, 'required', '', 'client') ;
|
229 |
alex |
99 |
|
300 |
alex |
100 |
$this->addElement ('textarea', 'description', ADAP_DESCRIPTION, array ('cols' => 50, 'rows' => 5)) ;
|
|
|
101 |
$this->addElement ('text', 'chemin', ADAP_CHEMIN, array('size' => 50)) ;
|
|
|
102 |
$this->addElement ('checkbox', 'applette', ADAP_APPLETTE, '', 0) ;
|
229 |
alex |
103 |
|
300 |
alex |
104 |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAP_CHAMPS_REQUIS) ;
|
229 |
alex |
105 |
// on fait un groupe avec les boutons pour les mettres sur la même ligne
|
300 |
alex |
106 |
$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);
|
229 |
alex |
108 |
$this->addGroup($buttons, null, null, ' ');
|
|
|
109 |
} // end of member function _construitFormulaire
|
|
|
110 |
} // end of HTML_formulaireProjet
|
|
|
111 |
?>
|