Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 331 → Rev 332

/trunk/papyrus/applications/admin_auth/bibliotheque/HTML_formulaireAuth.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireAuth.class.php,v 1.2 2004-12-06 12:43:21 alex Exp $
// CVS : $Id: HTML_formulaireAuth.class.php,v 1.3 2005-04-14 13:54:51 jpm Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
69,9 → 69,18
* @return void
* @access public
*/
function HTML_formulaireAuth( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
function HTML_formulaireAuth($formName = '', $method = 'post', $action = '', $target = '_self', $attributes = '', $trackSubmit = false)
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit);
$squelette =& $this->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
$squelette->setElementTemplate( '<li>'."\n".
'{label}'."\n".
'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
} // end of member function HTML_formulaireProjet
 
/**
80,10 → 89,10
* @return string
* @access public
*/
function toHTML( )
function toHTML()
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
$res = HTML_QuickForm::toHTML();
return $res;
} // end of member function toHTML
 
/**
94,39 → 103,79
*/
function construitFormulaire($url_retour)
{
$this->addElement ('text', 'nom_auth', ADAU_NOM_AUTH, array ('size' => 60)) ;
$this->addRule ('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client') ;
$tab_index = 1000;
$size = 60;
$cols = 50;
$rows = 6;
$form_debut = '<fieldset>'."\n".'<legend>'.ADAU_NOM_FORM.'</legend>'."\n".'<ul>'."\n";
$this->addElement('html', $form_debut);
$this->addElement ('text', 'abreviation', ADAU_ABREVIATION) ;
$this->addRule ('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client') ;
$id = 'nom_auth';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_NOM_AUTH.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client');
$this->addElement ('text', 'dsn', ADAU_DSN) ;
$this->addRule ('dsn', ADAU_DSN_ALERTE, 'required', '', 'client') ;
$id = 'abreviation';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_ABREVIATION.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client');
$id = 'dsn';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_DSN.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('dsn', ADAU_DSN_ALERTE, 'required', '', 'client');
$this->addElement ('text', 'nom_table', ADAU_NOM_TABLE) ;
$this->addRule ('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client') ;
$id = 'nom_table';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_NOM_TABLE.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client');
$id = 'champs_login';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_CHAMPS_LOGIN.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client');
$this->addElement ('text', 'champs_login', ADAU_CHAMPS_LOGIN) ;
$this->addRule ('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client') ;
$id = 'champs_passe';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_CHAMPS_PASSE.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client');
$id = 'cryptage';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_CRYPTAGE.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client');
$this->addElement ('text', 'champs_passe', ADAU_CHAMPS_PASSE) ;
$this->addRule ('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client') ;
$id = 'parametres';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => $rows, 'cols' => $cols);
$label = '<label for="'.$id.'">'.ADAU_PARAMETRE.'</label>';
$this->addElement('textarea', $id, $label, $aso_attributs);
$form_fin = '</ul>'."\n".'</fieldset>'."\n";
$this->addElement('html', $form_fin);
$this->addElement ('text', 'cryptage', ADAU_CRYPTAGE) ;
$this->addRule ('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client') ;
 
$this->addElement ('text', 'parametres', ADAU_PARAMETRE) ;
// Gestion des boutons
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
$this->addElement('html', $liste_bouton_debut);
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAU_CHAMPS_REQUIS) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAU_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAU_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
$this->addElement('submit', 'valider', ADAU_VALIDER);
$bouton_annuler = '<li><a class="bouton" href="'.str_replace ('&amp;', '&', $url_retour->getURL()).'">'.ADAU_ANNULER.'</a></li>'."\n";
$this->addElement('html', $bouton_annuler);
$liste_bouton_fin = '</ul>'."\n";
$this->addElement('html', $liste_bouton_fin);
$this->setRequiredNote(ADAU_CHAMPS_REQUIS);
} // end of member function _construitFormulaire
 
} // end of HTML_formulaireProjet