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