Subversion Repositories Applications.papyrus

Rev

Rev 946 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 946 Rev 1293
Line 17... Line 17...
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.8 2006-09-18 09:54:10 alexandre_tb Exp $
22
// CVS : $Id: adwi_HTML_formulaireWikini.class.php,v 1.9 2007-04-06 08:40:13 neiluj 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
Line 30... Line 30...
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.8 $
35
*@version       $Revision: 1.9 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
Line 38... Line 38...
38
 
38
 
Line 56... Line 56...
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
	
-
 
62
	var $me;
-
 
63
	var $squelette;
-
 
64
	
61
    /**
65
    /**
62
     * Constructeur
66
     * Constructeur
63
     *
67
     *
64
     * @param string formName Le nom du formulaire.
68
     * @param string formName Le nom du formulaire.
65
     * @param string method Soit get soit post, voir le protocole HTTP
69
     * @param string method Soit get soit post, voir le protocole HTTP
Line 71... Line 75...
71
     * @access public
75
     * @access public
72
     */
76
     */
73
    function HTML_formulaireWikini( $formName = "",  $method = "post",  $action = "",  $target = "_self",  $attributes = "",  $trackSubmit = false )
77
    function HTML_formulaireWikini( $formName = "",  $method = "post",  $action = "",  $target = "_self",  $attributes = "",  $trackSubmit = false )
74
    {
78
    {
75
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
79
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
-
 
80
    	$this->squelette = & $this->defaultRenderer();
76
    } // end of member function HTML_formulaireProjet
81
    } // end of member function HTML_formulaireProjet
Line 77... Line 82...
77
 
82
 
78
    /**
83
    /**
79
     * Renvoie le code HTML du formulaire.
84
     * Renvoie le code HTML du formulaire.
Line 82... Line 87...
82
     * @access public
87
     * @access public
83
     */
88
     */
84
    function toHTML( )
89
    function toHTML( )
85
    {
90
    {
86
        $res = HTML_QuickForm::toHTML() ;
91
        $res = HTML_QuickForm::toHTML() ;
87
        return $res ;
92
       return $res ;
88
    } // end of member function toHTML
93
    } // end of member function toHTML
Line 89... Line 94...
89
 
94
 
90
    /**
95
    /**
91
     * Ajoute les champs nécessaire au formulaire.
96
     * Ajoute les champs nécessaire au formulaire.
92
     *
97
     *
93
     * @return void
98
     * @return void
94
     * @access public
99
     * @access public
95
     */
100
     */
96
    function construitFormulaire($url_retour)
101
    function construitFormulaire($url_retour)
-
 
102
    {
-
 
103
		// template
-
 
104
		$this->addElement('html'," 
-
 
105
			<script type=\"text/javascript\">
-
 
106
				//<![CDATA[
-
 
107
				var options = false;
-
 
108
				function showOptions() { 
-
 
109
							el = document.getElementById(\"advanced\");
-
 
110
							btn = document.getElementById('optionsbtn');
-
 
111
							if (!options) {
-
 
112
									el.style.display = 'block';
-
 
113
									options = true;
-
 
114
									btn.value = 'Options Avancees <<';
-
 
115
							}else{
-
 
116
							   	el.style.display = 'none';
-
 
117
							   	options = false;
-
 
118
							   	btn.value = 'Options Avancees >>';
-
 
119
						}
-
 
120
						return options;
-
 
121
				}
-
 
122
				//]]>
-
 
123
				</script>");
-
 
124
				
-
 
125
		
-
 
126
		$this->squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
-
 
127
		$this->squelette->setElementTemplate( '<p class="formulaire_element">'."\n".'<label>'."\n".
-
 
128
			'{label}'."\n".
-
 
129
			'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->&nbsp;'."\n".
-
 
130
			'</label>'."\n".
-
 
131
			'{element}'."\n".
-
 
132
			'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
-
 
133
			'</p>'."\n");
-
 
134
		
-
 
135
		$this->squelette->setRequiredNoteTemplate("\n".'<p class="symbole_obligatoire">*&nbsp;:&nbsp;{requiredNote}</p>'."\n");
97
    {
136
	
98
 
137
		
99
        $this->addElement ('text', 'code_alpha_wikini', ADWI_NOM_WIKINI, array ('size' => 60)) ;
138
        $this->addElement ('text', 'code_alpha_wikini', ADWI_NOM_WIKINI, array('class' => 'champs_input')) ;
-
 
139
        $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_ALERTE, 'required', '', 'client') ;
100
        $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_ALERTE, 'required', '', 'client') ;
140
		// UPDATE: Depuis la nouvelle fonction genere_nom_wiki() les espaces / accents sont autorisés.
-
 
141
		// $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_NON_VALIDE, 'lettersonly', '', 'client');
101
		$this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_NON_VALIDE, 'lettersonly', '', 'client');
142
        $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_NON_VALIDE, 'required', '', 'client');
102
        // Défault : PagePrincipale
143
        // Défaut : PagePrincipale
-
 
144
        $this->addElement ('text', 'page', ADWI_PAGE, array('class' => 'champs_input')) ;
-
 
145
        $this->addElement('button', 'Options Avanc&eacute;es >>', 'Options Avancees >>', array ("onclick" => "showOptions()",
-
 
146
        												'id' => 'optionsbtn', 'class' => 'bouton'));
103
        $this->addElement ('text', 'page', ADWI_PAGE, array ('size' => 60)) ;
147
		$this->addElement ('html', '<div id="advanced" style="display:none;">');
104
 
148
     
105
        $this->addElement ('static', '', 'Configuration avancée : ') ;
149
       // $this->addElement ('static', '', 'Configuration avanc&eacute;e : ') ;
106
 
150
 
107
        $this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array ('size' => 60)) ;
151
        $this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array('class' => 'champs_input')) ;
108
        $this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array ('size' => 60)) ;
152
        $this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array('class' => 'champs_input')) ;
109
        $this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array ('size' => 60)) ;
153
        $this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array('class' => 'champs_input')) ;
110
        $this->addElement ('password', 'bdd_mdp', ADWI_BDD_MDP, array ('size' => 60)) ;
154
        $this->addElement ('password', 'bdd_mdp', ADWI_BDD_MDP, array('class' => 'champs_input')) ;
111
        $this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array ('size' => 60)) ;
155
        $this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array('class' => 'champs_input')) ;
Line 112... Line 156...
112
        $this->addElement ('text', 'chemin', ADWI_CHEMIN, array ('size' => 60)) ;
156
        $this->addElement ('text', 'chemin', ADWI_CHEMIN, array('class' => 'champs_input')) ;
113
 
157
 
-
 
158
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ;
-
 
159
		 
114
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ;
160
		$this->addElement ('html', '</div>');
115
 
161
		
116
        // on fait un groupe avec les boutons pour les mettres sur la même ligne
162
        // 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())."'",
163
        $buttons[] = $this->createElement('button', 'annuler', ADWI_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'",
118
        												'id' => 'annuler', 'class' => 'bouton'));
164
        												'id' => 'annuler', 'class' => 'bouton'));
119
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADWI_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));
165
        $buttons[] = $this->createElement('submit', 'valider', ADWI_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));
120
        $this->addGroup($buttons, null, null, '&nbsp;');
166
        $this->addGroup($buttons, null, null, '&nbsp;');
121
 
167
       
122
    } // end of member function _construitFormulaire
168
    } // end of member function _construitFormulaire