Subversion Repositories Applications.papyrus

Rev

Rev 439 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 439 Rev 600
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: adwi_HTML_formulaireWikini.class.php,v 1.4 2005-09-09 09:37:17 ddelon Exp $
22
// CVS : $Id: adwi_HTML_formulaireWikini.class.php,v 1.5 2005-11-14 13:07:11 ddelon Exp $
23
/**
23
/**
24
* 
24
*
25
* Admin Wikini
25
* Admin Wikini
26
*
26
*
27
* Classe affichage gestion des Wikini de Papyrus
27
* Classe affichage gestion des Wikini de Papyrus
28
*
28
*
29
*@package projet
29
*@package projet
30
//Auteur original :
30
//Auteur original :
31
*@author        David Delon <david.delon@clapas.net>
31
*@author        David Delon <david.delon@clapas.net>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@author        Aucun
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2004
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.4 $
35
*@version       $Revision: 1.5 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
38
 
38
 
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
41
// |                                            ENTETE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
 
43
 
44
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
44
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
45
 
45
 
46
require_once 'HTML/QuickForm.php' ;
46
require_once 'HTML/QuickForm.php' ;
47
require_once 'HTML/QuickForm/checkbox.php' ;
47
require_once 'HTML/QuickForm/checkbox.php' ;
48
require_once 'HTML/QuickForm/select.php' ;
48
require_once 'HTML/QuickForm/select.php' ;
49
 
49
 
50
// +------------------------------------------------------------------------------------------------------+
50
// +------------------------------------------------------------------------------------------------------+
51
// |                                           LISTE des constantes                                       |
51
// |                                           LISTE des constantes                                       |
52
// +------------------------------------------------------------------------------------------------------+
52
// +------------------------------------------------------------------------------------------------------+
53
 
53
 
54
 
54
 
55
/**
55
/**
56
 * class HTML_formulaireProjet
56
 * class HTML_formulaireProjet
57
 * Cette classe représente un formulaire pour saisir un wikini ou le modifier
57
 * Cette classe représente un formulaire pour saisir un wikini ou le modifier
58
 */
58
 */
59
class HTML_formulaireWikini extends HTML_QuickForm
59
class HTML_formulaireWikini extends HTML_QuickForm
60
{
60
{
61
    /**
61
    /**
62
     * Constructeur
62
     * Constructeur
63
     *
63
     *
64
     * @param string formName Le nom du formulaire.
64
     * @param string formName Le nom du formulaire.
65
     * @param string method Soit get soit post, voir le protocole HTTP
65
     * @param string method Soit get soit post, voir le protocole HTTP
66
     * @param string action L'action du formulaire.
66
     * @param string action L'action du formulaire.
67
     * @param string target La cible du formulaire.
67
     * @param string target La cible du formulaire.
68
     * @param Array attributes Des attributs supplémentaires pour la balise <form>
68
     * @param Array attributes Des attributs supplémentaires pour la balise <form>
69
     * @param bool trackSubmit Pour repérer si la formulaire a été soumis.
69
     * @param bool trackSubmit Pour repérer si la formulaire a été soumis.
70
     * @return void
70
     * @return void
71
     * @access public
71
     * @access public
72
     */
72
     */
73
    function HTML_formulaireWikini( $formName = "",  $method = "post",  $action = "",  $target = "_self",  $attributes = "",  $trackSubmit = false )
73
    function HTML_formulaireWikini( $formName = "",  $method = "post",  $action = "",  $target = "_self",  $attributes = "",  $trackSubmit = false )
74
    {
74
    {
75
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
75
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
76
    } // end of member function HTML_formulaireProjet
76
    } // end of member function HTML_formulaireProjet
77
 
77
 
78
    /**
78
    /**
79
     * Renvoie le code HTML du formulaire.
79
     * Renvoie le code HTML du formulaire.
80
     *
80
     *
81
     * @return string
81
     * @return string
82
     * @access public
82
     * @access public
83
     */
83
     */
84
    function toHTML( )
84
    function toHTML( )
85
    {
85
    {
86
        $res = HTML_QuickForm::toHTML() ;
86
        $res = HTML_QuickForm::toHTML() ;
87
        return $res ;
87
        return $res ;
88
    } // end of member function toHTML
88
    } // end of member function toHTML
89
 
89
 
90
    /**
90
    /**
91
     * Ajoute les champs nécessaire au formulaire.
91
     * Ajoute les champs nécessaire au formulaire.
92
     *
92
     *
93
     * @return void
93
     * @return void
94
     * @access public
94
     * @access public
95
     */
95
     */
96
    function construitFormulaire($url_retour)
96
    function construitFormulaire($url_retour)
97
    {
97
    {
98
    	
98
 
99
        $this->addElement ('text', 'code_alpha_wikini', ADWI_NOM_WIKINI, array ('size' => 60)) ;
99
        $this->addElement ('text', 'code_alpha_wikini', ADWI_NOM_WIKINI, array ('size' => 60)) ;
100
        $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_ALERTE, 'required', '', 'client') ;
100
        $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_ALERTE, 'required', '', 'client') ;
101
        
101
 
102
        // Défault : PagePrincipale
102
        // Défault : PagePrincipale
103
        $this->addElement ('text', 'page', ADWI_PAGE, array ('size' => 60)) ;
103
        $this->addElement ('text', 'page', ADWI_PAGE, array ('size' => 60)) ;
104
        
104
 
105
        $this->addElement ('static', '', 'Configuration avancée : ') ;
105
        $this->addElement ('static', '', 'Configuration avancée : ') ;
106
        
106
 
107
        $this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array ('size' => 60)) ;
107
        $this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array ('size' => 60)) ;
108
        $this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array ('size' => 60)) ;
108
        $this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array ('size' => 60)) ;
109
        $this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array ('size' => 60)) ;
109
        $this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array ('size' => 60)) ;
110
        $this->addElement ('text', 'bdd_mdp', ADWI_BDD_MDP, array ('size' => 60)) ;
110
        $this->addElement ('password', 'bdd_mdp', ADWI_BDD_MDP, array ('size' => 60)) ;
111
        $this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array ('size' => 60)) ;
111
        $this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array ('size' => 60)) ;
112
        $this->addElement ('text', 'chemin', ADWI_CHEMIN, array ('size' => 60)) ;
112
        $this->addElement ('text', 'chemin', ADWI_CHEMIN, array ('size' => 60)) ;
113
 
113
 
114
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ;
114
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ;
115
        
115
 
116
        // on fait un groupe avec les boutons pour les mettres sur la même ligne
116
        // on fait un groupe avec les boutons pour les mettres sur la même ligne
117
        $buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADWI_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
117
        $buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADWI_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
118
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADWI_VALIDER);
118
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADWI_VALIDER);
119
        $this->addGroup($buttons, null, null, '&nbsp;');
119
        $this->addGroup($buttons, null, null, '&nbsp;');
120
        
120
 
121
    } // end of member function _construitFormulaire
121
    } // end of member function _construitFormulaire
122
} // end of HTML_formulaireProjet
122
} // end of HTML_formulaireProjet
123
?>
123
?>