Line 19... |
Line 19... |
19 |
// | |
|
19 |
// | |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
24 |
// CVS : $Id: moteur_recherche.php,v 1.2 2005-02-22 17:44:03 jpm Exp $
|
24 |
// CVS : $Id: moteur_recherche.php,v 1.3 2005-02-22 19:27:21 jpm Exp $
|
25 |
/**
|
25 |
/**
|
26 |
* Applette : moteur de recherche
|
26 |
* Applette : moteur de recherche
|
27 |
*
|
27 |
*
|
28 |
* Génère un formulaire contenant une zone de saisie permettant de taper un texte à rechercher sur l'ensemble
|
28 |
* Génère un formulaire contenant une zone de saisie permettant de taper un texte à rechercher sur l'ensemble
|
29 |
* des sites gérés par Papyrus.
|
29 |
* des sites gérés par Papyrus.
|
Line 33... |
Line 33... |
33 |
//Auteur original :
|
33 |
//Auteur original :
|
34 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
34 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
35 |
//Autres auteurs :
|
35 |
//Autres auteurs :
|
36 |
*@author Aucun
|
36 |
*@author Aucun
|
37 |
*@copyright Tela-Botanica 2000-2004
|
37 |
*@copyright Tela-Botanica 2000-2004
|
38 |
*@version $Revision: 1.2 $ $Date: 2005-02-22 17:44:03 $
|
38 |
*@version $Revision: 1.3 $ $Date: 2005-02-22 19:27:21 $
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
*/
|
40 |
*/
|
Line 41... |
Line 41... |
41 |
|
41 |
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
Line 51... |
Line 51... |
51 |
/** Inclusion de la bibliotheque permettant d'accéder aux fonctions sur les balises Meta.*/
|
51 |
/** Inclusion de la bibliotheque permettant d'accéder aux fonctions sur les balises Meta.*/
|
52 |
//require_once GEN_CHEMIN_BIBLIO.'pap_meta.fonct.php';
|
52 |
//require_once GEN_CHEMIN_BIBLIO.'pap_meta.fonct.php';
|
53 |
//Utilisation de la bibliothèque PEAR NET_URL
|
53 |
//Utilisation de la bibliothèque PEAR NET_URL
|
54 |
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
|
54 |
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
|
55 |
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
|
55 |
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
|
- |
|
56 |
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/
|
- |
|
57 |
require_once 'HTML/QuickForm/Renderer/Default.php';
|
Line 56... |
Line 58... |
56 |
|
58 |
|
57 |
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
|
59 |
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
|
58 |
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$_GEN_commun['i18n'].'.inc.php')) {
|
60 |
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$_GEN_commun['i18n'].'.inc.php')) {
|
59 |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
|
61 |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
|
Line 159... |
Line 161... |
159 |
|
161 |
|
160 |
// --------------------------------------------------------------------------------------------------------
|
162 |
// --------------------------------------------------------------------------------------------------------
|
Line 161... |
Line 163... |
161 |
// Création du formulaire de l'applette
|
163 |
// Création du formulaire de l'applette
|
162 |
|
164 |
|
163 |
// Notes : Quickform semble remplacer les & des & à nouveau par des & solution utiliser str_replace()...
|
165 |
// Notes : Quickform semble remplacer les & des & à nouveau par des & solution utiliser str_replace()...
|
164 |
$form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&', '&', $url->getUrl()));
|
166 |
$more_form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&', '&', $url->getUrl()));
|
165 |
$tab_index = MORE_FORM_MOTIF_TAB;
|
167 |
$tab_index = MORE_FORM_MOTIF_TAB;
|
166 |
$squelette =& $form->defaultRenderer();
|
168 |
$more_squelette =& $more_form->defaultRenderer();
|
167 |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
|
169 |
$more_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
|
168 |
$squelette->setElementTemplate( '{label}'."\n".
|
170 |
$more_squelette->setElementTemplate( '{label}'."\n".
|
169 |
'{element}'."\n".
|
171 |
'{element}'."\n".
|
170 |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
|
172 |
'<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
|
- |
|
173 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n");
|
Line 171... |
Line 174... |
171 |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n");
|
174 |
$more_form->accept($more_squelette);
|
172 |
//$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
|
175 |
$more_form->removeAttribute('name');
|
Line 173... |
Line 176... |
173 |
|
176 |
|
174 |
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n";
|
177 |
$partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n";
|
175 |
$form->addElement('html', $partie_menu_debut);
|
178 |
$more_form->addElement('html', $partie_menu_debut);
|
176 |
|
179 |
|
177 |
$id = 'more_motif';
|
180 |
$id = 'more_motif';
|
Line 178... |
Line 181... |
178 |
$aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'size' => MORE_FORM_MOTIF_SIZE, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH,
|
181 |
$aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'size' => MORE_FORM_MOTIF_SIZE, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH,
|
179 |
'onclick' => "javascript: this.value='';");
|
182 |
'onclick' => "javascript: this.value='';");
|
180 |
$label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>';
|
183 |
$label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>';
|
Line 181... |
Line 184... |
181 |
$form->addElement('text', $id, $label, $aso_attributs);
|
184 |
$more_form->addElement('text', $id, $label, $aso_attributs);
|
182 |
|
185 |
|
Line 183... |
Line 186... |
183 |
$id = 'more_ok';
|
186 |
$id = 'more_ok';
|
184 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
187 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
Line 185... |
Line 188... |
185 |
$form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs);
|
188 |
$more_form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs);
|
186 |
|
189 |
|
187 |
$partie_entete_fin = "\n".'</fieldset>';
|
190 |
$partie_entete_fin = "\n".'</fieldset>';
|
Line 188... |
Line 191... |
188 |
$form->addElement('html', $partie_entete_fin);
|
191 |
$more_form->addElement('html', $partie_entete_fin);
|
189 |
|
192 |
|
Line 203... |
Line 206... |
203 |
|
206 |
|
204 |
|
207 |
|
205 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
208 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
209 |
*
|
- |
|
210 |
* $Log: not supported by cvs2svn $
|
- |
|
211 |
* Revision 1.2 2005/02/22 17:44:03 jpm
|
206 |
*
|
212 |
* Suppression de référence posant problème.
|
207 |
* $Log: not supported by cvs2svn $
|
213 |
*
|
208 |
* Revision 1.1 2004/12/07 10:24:01 jpm
|
214 |
* Revision 1.1 2004/12/07 10:24:01 jpm
|
209 |
* Moteur de recherche version de départ.
|
215 |
* Moteur de recherche version de départ.
|
210 |
*
|
216 |
*
|