Subversion Repositories Applications.papyrus

Rev

Rev 1087 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
448 ddelon 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
// +------------------------------------------------------------------------------------------------------+
474 alexandre_ 22
// CVS : $Id: HTML_formulaireCreationWikini.class.php,v 1.2 2005-09-27 16:39:47 alexandre_tb Exp $
448 ddelon 23
/**
24
* Application projet
25
*
26
* La classe HTML_formulaireCreationWikini
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
474 alexandre_ 34
*@version       $Revision: 1.2 $
448 ddelon 35
// +------------------------------------------------------------------------------------------------------+
36
*/
37
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
42
 
43
 
44
/**
45
 * class HTML_formulaireCreationWikini
46
 *
47
 */
48
class HTML_formulaireCreationWikini extends HTML_QuickForm
49
{
50
 
51
     /*** Attributes: ***/
52
 
53
    /**
54
     * Constructeur
55
     *
56
     * @return void
57
     * @access public
58
     */
59
    function HTML_formulaireCreationWikini($formName = "",  $method = "post",  $action = "",  $target = "_self",  $attributes = "",  $trackSubmit = false)
60
    {
61
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
62
    } // end of member function HTML_formulaireCreationWikini
63
 
64
    /**
65
     *
66
     *
67
     * @return void
68
     * @access public
69
     */
70
    function construitFormulaire( )
71
    {
72
 
73
        $this->addElement ('html', '<p>'.PROJET_WIKINI_NOM_EXPLICATION.'</p>') ;
74
        $this->addElement ('text', 'nom_wikini', PROJET_WIKINI_CHOISIR_NOM) ;
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') ;
77
 
78
        /*
79
        $this->addElement ('text', 'prefixe_wikini', PROJET_PREFIXE_WIKINI) ;
80
        $this->addRule ('prefixe_wikini', PROJET_PREFIXE_WIKINI_REQUIS, 'required', '', 'client');
81
        */
82
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
83
        $url_annuler = new Net_URL($this->getAttribute('action')) ;
84
        $url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
85
 
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,
88
                            preg_replace ("/&amp;/", "&", $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 &amp;
90
                                                                                                            // ce qui fait échouer le lien
91
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
92
        $this->addGroup($buttons, null, null, '&nbsp;');
93
    } // end of member function construitFormulaire
94
 
95
    /**
96
     * Renvoie le code HTML du formulaire.
97
     *
98
     * @return string
99
     * @access public
100
     */
101
    function toHTML( )
102
    {
103
        $res = HTML_QuickForm::toHTML() ;
104
        return $res ;
105
    } // end of member function toHTML
106
 
107
} // end of HTML_formulaireCreationWikini
108
?>