21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: moteur_recherche.php,v 1.2 2005-02-22 17:44:03 jpm Exp $ |
// CVS : $Id: moteur_recherche.php,v 1.3 2005-02-22 19:27:21 jpm Exp $ |
/** |
* Applette : moteur de recherche |
* |
35,7 → 35,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.2 $ $Date: 2005-02-22 17:44:03 $ |
*@version $Revision: 1.3 $ $Date: 2005-02-22 19:27:21 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
53,6 → 53,8 |
//Utilisation de la bibliothèque PEAR NET_URL |
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/ |
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php'; |
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/ |
require_once 'HTML/QuickForm/Renderer/Default.php'; |
|
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus |
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$_GEN_commun['i18n'].'.inc.php')) { |
161,37 → 163,38 |
// Création du formulaire de l'applette |
|
// Notes : Quickform semble remplacer les & des & à nouveau par des & solution utiliser str_replace()... |
$form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&', '&', $url->getUrl())); |
$more_form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&', '&', $url->getUrl())); |
$tab_index = MORE_FORM_MOTIF_TAB; |
$squelette =& $form->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'); |
$squelette->setElementTemplate( '{label}'."\n". |
$more_squelette =& $more_form->defaultRenderer(); |
$more_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'); |
$more_squelette->setElementTemplate( '{label}'."\n". |
'{element}'."\n". |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n"); |
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n"); |
$more_form->accept($more_squelette); |
$more_form->removeAttribute('name'); |
|
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n"; |
$form->addElement('html', $partie_menu_debut); |
$more_form->addElement('html', $partie_menu_debut); |
|
$id = 'more_motif'; |
$aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'size' => MORE_FORM_MOTIF_SIZE, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH, |
'onclick' => "javascript: this.value='';"); |
$label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>'; |
$form->addElement('text', $id, $label, $aso_attributs); |
$more_form->addElement('text', $id, $label, $aso_attributs); |
|
$id = 'more_ok'; |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++); |
$form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs); |
$more_form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs); |
|
$partie_entete_fin = "\n".'</fieldset>'; |
$form->addElement('html', $partie_entete_fin); |
$more_form->addElement('html', $partie_entete_fin); |
|
// Instanciation avec les valeur par défaut |
$form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']); |
$more_form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']); |
|
// Transformation en XHTML du formulaire |
$retour .= $form->toHTML()."\n"; |
$retour .= $more_form->toHTML()."\n"; |
// -------------------------------------------------------------------------------------------------------- |
|
return $retour; |
205,6 → 208,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.2 2005/02/22 17:44:03 jpm |
* Suppression de référence posant problème. |
* |
* Revision 1.1 2004/12/07 10:24:01 jpm |
* Moteur de recherche version de départ. |
* |