Subversion Repositories Applications.papyrus

Rev

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

Rev 1293 Rev 1298
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.9 2007-04-06 08:40:13 neiluj Exp $
22
// CVS : $Id: adwi_HTML_formulaireWikini.class.php,v 1.10 2007-04-11 08:30:12 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.9 $
35
*@version       $Revision: 1.10 $
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
	
-
 
65
    /**
61
    /**
66
     * Constructeur
62
     * Constructeur
67
     *
63
     *
68
     * @param string formName Le nom du formulaire.
64
     * @param string formName Le nom du formulaire.
69
     * @param string method Soit get soit post, voir le protocole HTTP
65
     * @param string method Soit get soit post, voir le protocole HTTP
Line 75... Line 71...
75
     * @access public
71
     * @access public
76
     */
72
     */
77
    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 )
78
    {
74
    {
79
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
75
        HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
80
    	$this->squelette = & $this->defaultRenderer();
-
 
81
    } // end of member function HTML_formulaireProjet
76
    } // end of member function HTML_formulaireProjet
Line 82... Line 77...
82
 
77
 
83
    /**
78
    /**
84
     * Renvoie le code HTML du formulaire.
79
     * Renvoie le code HTML du formulaire.
Line 87... Line 82...
87
     * @access public
82
     * @access public
88
     */
83
     */
89
    function toHTML( )
84
    function toHTML( )
90
    {
85
    {
91
        $res = HTML_QuickForm::toHTML() ;
86
        $res = HTML_QuickForm::toHTML() ;
92
       return $res ;
87
        return $res ;
93
    } // end of member function toHTML
88
    } // end of member function toHTML
Line 94... Line 89...
94
 
89
 
95
    /**
90
    /**
96
     * Ajoute les champs nécessaire au formulaire.
91
     * Ajoute les champs nécessaire au formulaire.
97
     *
92
     *
98
     * @return void
93
     * @return void
99
     * @access public
94
     * @access public
100
     */
95
     */
101
    function construitFormulaire($url_retour)
96
    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");
-
 
136
	
97
    {
137
		
98
 
138
        $this->addElement ('text', 'code_alpha_wikini', ADWI_NOM_WIKINI, array('class' => 'champs_input')) ;
99
        $this->addElement ('text', 'code_alpha_wikini', ADWI_NOM_WIKINI, array ('size' => 60)) ;
139
        $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.
100
        $this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_ALERTE, 'required', '', 'client') ;
141
		// $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');
101
		$this->addRule ('code_alpha_wikini', ADWI_NOM_WIKINI_NON_VALIDE, 'lettersonly', '', 'client');
143
        // Défaut : PagePrincipale
102
        // Défault : 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'));
-
 
147
		$this->addElement ('html', '<div id="advanced" style="display:none;">');
103
        $this->addElement ('text', 'page', ADWI_PAGE, array ('size' => 60)) ;
148
     
104
 
149
       // $this->addElement ('static', '', 'Configuration avanc&eacute;e : ') ;
105
        $this->addElement ('static', '', 'Configuration avancée : ') ;
150
 
106
 
151
        $this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array('class' => 'champs_input')) ;
107
        $this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array ('size' => 60)) ;
152
        $this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array('class' => 'champs_input')) ;
108
        $this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array ('size' => 60)) ;
153
        $this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array('class' => 'champs_input')) ;
109
        $this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array ('size' => 60)) ;
154
        $this->addElement ('password', 'bdd_mdp', ADWI_BDD_MDP, array('class' => 'champs_input')) ;
110
        $this->addElement ('password', 'bdd_mdp', ADWI_BDD_MDP, array ('size' => 60)) ;
155
        $this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array('class' => 'champs_input')) ;
111
        $this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array ('size' => 60)) ;
Line 156... Line 112...
156
        $this->addElement ('text', 'chemin', ADWI_CHEMIN, array('class' => 'champs_input')) ;
112
        $this->addElement ('text', 'chemin', ADWI_CHEMIN, array ('size' => 60)) ;
157
 
113
 
158
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ;
-
 
159
		 
-
 
160
		$this->addElement ('html', '</div>');
114
        $this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ;
161
		
115
 
162
        // 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
163
        $buttons[] = $this->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())."'",
164
        												'id' => 'annuler', 'class' => 'bouton'));
118
        												'id' => 'annuler', 'class' => 'bouton'));
165
        $buttons[] = $this->createElement('submit', 'valider', ADWI_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));
119
        $buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADWI_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));
166
        $this->addGroup($buttons, null, null, '&nbsp;');
120
        $this->addGroup($buttons, null, null, '&nbsp;');
167
       
121
 
168
    } // end of member function _construitFormulaire
122
    } // end of member function _construitFormulaire