Subversion Repositories Applications.papyrus

Rev

Rev 373 | Rev 754 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 373 Rev 467
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Papyrus.                                                                        |
8
// | This file is part of Papyrus.                                                                        |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
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.6 2005-05-25 13:49:22 jpm Exp $
24
// CVS : $Id: moteur_recherche.php,v 1.7 2005-09-27 09:07:32 ddelon 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.
30
* Utilisation des bibliothèques inclue par Papyrus :
30
* Utilisation des bibliothèques inclue par Papyrus :
31
* - Papyrus pap_meta.fonct.php
31
* - Papyrus pap_meta.fonct.php
32
* - PEAR NET_URL
32
* - PEAR NET_URL
33
*
33
*
34
*@package Applette
34
*@package Applette
35
*@subpackage Moteur_recherche
35
*@subpackage Moteur_recherche
36
//Auteur original :
36
//Auteur original :
37
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
37
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
38
//Autres auteurs :
38
//Autres auteurs :
39
*@author        Aucun
39
*@author        Aucun
40
*@copyright     Tela-Botanica 2000-2004
40
*@copyright     Tela-Botanica 2000-2004
41
*@version       $Revision: 1.6 $ $Date: 2005-05-25 13:49:22 $
41
*@version       $Revision: 1.7 $ $Date: 2005-09-27 09:07:32 $
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
*/
43
*/
44
 
44
 
45
// +------------------------------------------------------------------------------------------------------+
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                            ENTETE du PROGRAMME                                       |
46
// |                                            ENTETE du PROGRAMME                                       |
47
// +------------------------------------------------------------------------------------------------------+
47
// +------------------------------------------------------------------------------------------------------+
48
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherMoteurRecherche';
48
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherMoteurRecherche';
49
$GLOBALS['_GEN_commun']['info_applette_balise'] = 'MOTEUR_RECHERCHE';
49
$GLOBALS['_GEN_commun']['info_applette_balise'] = 'MOTEUR_RECHERCHE';
50
 
50
 
51
// --------------------------------------------------------------------------------------------------------
51
// --------------------------------------------------------------------------------------------------------
52
//Utilisation de la bibliothèque Papyrus pap_meta.fonct.php inclue par Papyrus
52
//Utilisation de la bibliothèque Papyrus pap_meta.fonct.php inclue par Papyrus
53
//Utilisation de la bibliothèque PEAR NET_URL inclue par Papyrus
53
//Utilisation de la bibliothèque PEAR NET_URL inclue par Papyrus
54
/** Inclusion du fichier de configuration de cette application.*/
54
/** Inclusion du fichier de configuration de cette application.*/
55
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_configuration.inc.php';
55
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_configuration.inc.php';
56
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
56
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
57
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
57
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
58
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/
58
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/
59
require_once 'HTML/QuickForm/Renderer/Default.php';
59
require_once 'HTML/QuickForm/Renderer/Default.php';
60
 
60
 
61
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
61
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
62
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
62
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
63
    /** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
63
    /** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
64
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
64
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
65
} else {
65
} else {
66
    /** Inclusion du fichier de traduction par défaut.*/
66
    /** Inclusion du fichier de traduction par défaut.*/
67
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.MORE_I18N_DEFAUT.'.inc.php';
67
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.MORE_I18N_DEFAUT.'.inc.php';
68
}
68
}
69
 
69
 
70
// +------------------------------------------------------------------------------------------------------+
70
// +------------------------------------------------------------------------------------------------------+
71
// |                                            CORPS du PROGRAMME                                        |
71
// |                                            CORPS du PROGRAMME                                        |
72
// +------------------------------------------------------------------------------------------------------+
72
// +------------------------------------------------------------------------------------------------------+
73
 
73
 
74
if (isset($_POST['more_motif']) && $_POST['more_motif'] != '') {
74
if (isset($_POST['more_motif']) && $_POST['more_motif'] != '') {
75
    // Initialisation de variable extérieures
75
    // Initialisation de variable extérieures
76
    $GLOBALS['_VEI_']['usurpation'] = 'Recherche de '.$_POST['more_motif'];
76
    $GLOBALS['_VEI_']['usurpation'] = 'Recherche de '.$_POST['more_motif'];
77
    $GLOBALS['_GEN_commun']['info_menu'] = null;
77
    $GLOBALS['_GEN_commun']['info_menu'] = null;
78
    $GLOBALS['_PAPYRUS_']['general']['application_chemin'] = null;
78
    $GLOBALS['_PAPYRUS_']['general']['application_chemin'] = null;
79
    // Titre de la page
79
    // Titre de la page
80
    $GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = 'Résultat de la recherche de '.$_POST['more_motif'];
80
    $GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = 'Résultat de la recherche de '.$_POST['more_motif'];
81
    // Modification des meta de l'entête de la page
81
    // Modification des meta de l'entête de la page
82
    GEN_modifierMetaHttpEquiv('Content-Type', 'text/html; charset=iso-8859-15');
82
    GEN_modifierMetaHttpEquiv('Content-Type', 'text/html; charset=iso-8859-15');
83
    GEN_modifierMetaHttpEquiv('Content-style-type', 'text/css');
83
    GEN_modifierMetaHttpEquiv('Content-style-type', 'text/css');
84
    GEN_modifierMetaHttpEquiv('Content-script-type', 'text/javascript');
84
    GEN_modifierMetaHttpEquiv('Content-script-type', 'text/javascript');
85
    GEN_modifierMetaHttpEquiv('Content-language', $GLOBALS['_GEN_commun']['i18n']);
85
    GEN_modifierMetaHttpEquiv('Content-language', $GLOBALS['_GEN_commun']['i18n']);
86
    
86
    
87
    GEN_modifierMetaName('revisit-after', '15 days');
87
    GEN_modifierMetaName('revisit-after', '15 days');
88
    GEN_modifierMetaName('robots', 'index,follow');
88
    GEN_modifierMetaName('robots', 'index,follow');
89
    GEN_modifierMetaName('author', 'Tela Botanica');
89
    GEN_modifierMetaName('author', 'Tela Botanica');
90
    GEN_modifierMetaName('keywords', 'Recherche, résultat.');
90
    GEN_modifierMetaName('keywords', 'Recherche, résultat.');
91
    GEN_modifierMetaName('description', 'Page de résultats du moteur de recherche de Papyrus.');
91
    GEN_modifierMetaName('description', 'Page de résultats du moteur de recherche de Papyrus.');
92
    
92
    
93
    GEN_viderMeta('dc');
93
    GEN_viderMeta('dc');
94
}
94
}
95
 
95
 
96
// +------------------------------------------------------------------------------------------------------+
96
// +------------------------------------------------------------------------------------------------------+
97
// |                                           LISTE de FONCTIONS                                         |
97
// |                                           LISTE de FONCTIONS                                         |
98
// +------------------------------------------------------------------------------------------------------+
98
// +------------------------------------------------------------------------------------------------------+
99
 
99
 
100
/** Fonnction afficherMoteurRecherche() - Fournit un formulaire de recherche.
100
/** Fonnction afficherMoteurRecherche() - Fournit un formulaire de recherche.
101
*
101
*
102
* Renvoie un formulaire permettant de rechercher une chaine de caractères dans les sites
102
* Renvoie un formulaire permettant de rechercher une chaine de caractères dans les sites
103
* gérés par Papyrus.
103
* gérés par Papyrus.
104
* Necessite l'utilisation de Pear Net_URL par le programme appelant cette fonction.
104
* Necessite l'utilisation de Pear Net_URL par le programme appelant cette fonction.
105
*
105
*
106
* @param  array  tableau d'éventuel arguments présent dans la balise transmis à la fonction. 
106
* @param  array  tableau d'éventuel arguments présent dans la balise transmis à la fonction. 
107
* @param  array  tableau global de Papyrus.
107
* @param  array  tableau global de Papyrus.
108
* @return string  formulaire XHTML de recherche.
108
* @return string  formulaire XHTML de recherche.
109
*/
109
*/
110
function afficherMoteurRecherche($tab_applette_arguments, $_GEN_commun)
110
function afficherMoteurRecherche($tab_applette_arguments, $_GEN_commun)
111
{
111
{
112
    // --------------------------------------------------------------------------------------------------------
112
    // --------------------------------------------------------------------------------------------------------
113
    // Initialisation de variable de configuration.
113
    // Initialisation de variable de configuration.
114
    $liste_type_site = '102, 103';// Les id des types des sites pouvant apparaître dans le sélecteur
114
    $liste_type_site = '102, 103';// Les id des types des sites pouvant apparaître dans le sélecteur
115
    $objet_pear_db =& $_GEN_commun['pear_db'];//objet Pear créé par DB contenant la connexion à la base de données.
115
    $objet_pear_db =& $_GEN_commun['pear_db'];//objet Pear créé par DB contenant la connexion à la base de données.
116
    $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] =& $_GEN_commun['pear_db'];// Connexion à la BD de Papyrus
116
    $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] =& $_GEN_commun['pear_db'];// Connexion à la BD de Papyrus
117
    $code_site = $_GEN_commun['url_site'];// identifiant du site courant.
117
    $code_site = $_GEN_commun['url_site'];// identifiant du site courant.
118
    $id_langue = $_GEN_commun['url_i18n'];// identifiant de la langue principale du site courant.
118
    $id_langue = $_GEN_commun['url_i18n'];// identifiant de la langue principale du site courant.
119
    $url = $_GEN_commun['url'];
119
    $url = $_GEN_commun['url'];
120
    $url_base = PAP_URL;
120
    $url_base = PAP_URL;
121
    $url_cle_site = GEN_URL_CLE_SITE;
121
    $url_cle_site = GEN_URL_CLE_SITE;
122
    $url_cle_i18n = GEN_URL_CLE_I18N;
122
    $url_cle_i18n = GEN_URL_CLE_I18N;
123
    $url_id_type_site = GEN_URL_ID_TYPE_SITE;
123
    $url_id_type_site = GEN_URL_ID_TYPE_SITE;
124
    $indent_origine = 12;// Indentation de départ en nombre d'espace
124
    $indent_origine = 12;// Indentation de départ en nombre d'espace
125
    $indent_pas     = 4;// Pas d'indentation en nombre d'espace
125
    $indent_pas     = 4;// Pas d'indentation en nombre d'espace
126
    $retour = '';
126
    $retour = '';
127
    $retour_resultats = '';
127
    $retour_resultats = '';
128
    
128
    
129
    // --------------------------------------------------------------------------------------------------------
129
    // --------------------------------------------------------------------------------------------------------
130
    // Lancement de la recherche si nécessaire
130
    // Lancement de la recherche si nécessaire
131
    
131
    
132
    $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = '';
132
    $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = '';
133
    if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') {
133
    if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') {
134
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE;
134
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE;
135
    } else {
135
    } else {
136
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = $_POST['more_motif'];
136
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = $_POST['more_motif'];
137
        /** Inclusion de la classe Recherche.*/
137
        /** Inclusion de la classe Recherche.*/
138
        require_once MORE_CHEMIN_BIBLIO.'more_recherche.class.php';
138
        require_once MORE_CHEMIN_BIBLIO.'more_recherche.class.php';
139
        /** Inclusion de la classe Recherche_Menu_Meta.*/
139
        /** Inclusion de la classe Recherche_Menu_Meta.*/
140
        require_once MORE_CHEMIN_BIBLIO.'more_recherche_papyrus_menu.class.php';
140
        require_once MORE_CHEMIN_BIBLIO.'more_recherche_papyrus_menu.class.php';
141
        $moteur = new Recherche($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
141
        $moteur = new Recherche($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
142
        $recherche_papyrus_menu = new Recherche_Papyrus_Menu($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
142
        $recherche_papyrus_menu = new Recherche_Papyrus_Menu($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
143
        $moteur->ajouterRecherche($recherche_papyrus_menu);
143
        $moteur->ajouterRecherche($recherche_papyrus_menu);
144
        $aso_resultats = $moteur->rechercherMotif();
144
        $aso_resultats = $moteur->rechercherMotif();
145
        //$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($aso_resultats, true).'</pre>';
145
        //$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($aso_resultats, true).'</pre>';
146
        $retour_resultats .= '<h1>'.MORE_LG_RESULTAT_TITRE.'</h1>'."\n";
146
        $retour_resultats .= '<h1>'.MORE_LG_RESULTAT_TITRE.'</h1>'."\n";
147
        if (count($aso_resultats) == 0) {
147
        if (count($aso_resultats) == 0) {
148
            $retour_resultats .= '<p class="information">'.MORE_LG_RESULTAT_VIDE.'</p>'."\n";
148
            $retour_resultats .= '<p class="information">'.MORE_LG_RESULTAT_VIDE.'</p>'."\n";
149
        } else {
149
        } else {
150
            $retour_resultats .= '<ul id="more_resultat">'."\n";
150
            $retour_resultats .= '<ul id="more_resultat">'."\n";
151
            foreach ($aso_resultats as $val) {
151
            foreach ($aso_resultats as $val) {
152
                if (!empty($val['url'])) {
152
                if (!empty($val['url'])) {
153
                    $retour_resultats .= '<li>'."\n";
153
                    $retour_resultats .= '<li>'."\n";
154
                    $retour_resultats .=    '<h2><a href="'.$val['url'].'" ';
154
                    $retour_resultats .=    '<h2><a href="'.$val['url'].'" ';
155
                    if ($val['hreflang'] != '') {
155
                    if ($val['hreflang'] != '') {
156
                        $retour_resultats .= 'hreflang="'.$val['hreflang'].'" ';
156
                        $retour_resultats .= 'hreflang="'.$val['hreflang'].'" ';
157
                    }
157
                    }
158
                    if ($val['accesskey'] != '') {
158
                    if ($val['accesskey'] != '') {
159
                        $retour_resultats .= 'accesskey="'.$val['accesskey'].'" ';
159
                        $retour_resultats .= 'accesskey="'.$val['accesskey'].'" ';
160
                    }
160
                    }
161
                    if ($val['title'] != '') {
161
                    if ($val['title'] != '') {
162
                        $retour_resultats .= 'title="'.$val['title'].'" ';
162
                        $retour_resultats .= 'title="'.$val['title'].'" ';
163
                    }
163
                    }
164
                    $retour_resultats .= '>'.$val['titre'].'</a></h2>';
164
                    $retour_resultats .= '>'.$val['titre'].'</a></h2>';
165
                    $retour_resultats .= '<dl>'."\n";
165
                    $retour_resultats .= '<dl>'."\n";
166
                    //if (trim($val['poids']) != '') {
166
                    //if (trim($val['poids']) != '') {
167
                    //    $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_POIDS.'</dt>'."\n";
167
                    //    $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_POIDS.'</dt>'."\n";
168
                    //    $retour_resultats .= '<dd>'.$val['poids'].'</dd>'."\n";
168
                    //    $retour_resultats .= '<dd>'.$val['poids'].'</dd>'."\n";
169
                    //}
169
                    //}
170
                    if (trim($val['score']) != '') {
170
                    if (trim($val['score']) != '') {
171
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_SCORE.'</dt>'."\n";
171
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_SCORE.'</dt>'."\n";
172
                        $retour_resultats .= '<dd>'.$val['score'].MORE_LG_RESULTAT_POURCENT.'</dd>'."\n";
172
                        $retour_resultats .= '<dd>'.$val['score'].MORE_LG_RESULTAT_POURCENT.'</dd>'."\n";
173
                    }
173
                    }
174
                    if (trim($val['date_creation']) != '') {
174
                    if (trim($val['date_creation']) != '') {
175
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DATE_CREATION.'</dt>'."\n";
175
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DATE_CREATION.'</dt>'."\n";
176
                        $retour_resultats .= '<dd>'.$val['date_creation'].'</dd>'."\n";
176
                        $retour_resultats .= '<dd>'.$val['date_creation'].'</dd>'."\n";
177
                    }
177
                    }
178
                    if (trim($val['description']) != '') {
178
                    if (trim($val['description']) != '') {
179
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DESCRIPTION.'</dt>'."\n";
179
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DESCRIPTION.'</dt>'."\n";
180
                        $retour_resultats .= '<dd>'.$val['description'].'</dd>'."\n";
180
                        $retour_resultats .= '<dd>'.$val['description'].'</dd>'."\n";
181
                    }
181
                    }
182
                    $retour_resultats .= '</dl>'."\n";
182
                    $retour_resultats .= '</dl>'."\n";
183
                    $retour_resultats .= '</li>'."\n";
183
                    $retour_resultats .= '</li>'."\n";
184
                }
184
                }
185
            }
185
            }
186
            $retour_resultats .= '</ul>'."\n";
186
            $retour_resultats .= '</ul>'."\n";
187
        }
187
        }
188
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
188
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
189
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
189
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
190
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = $retour_resultats;
190
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = $retour_resultats;
191
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '';
191
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '';
192
        $GLOBALS['_GEN_commun']['info_menu'] = '';
192
        $GLOBALS['_GEN_commun']['info_menu'] = '';
193
    }
193
    }
194
    
194
    
195
    // --------------------------------------------------------------------------------------------------------
195
    // --------------------------------------------------------------------------------------------------------
196
    // Création du formulaire de l'applette
196
    // Création du formulaire de l'applette
197
    
197
    
198
    // Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
198
    // Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
199
    $more_form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&amp;', '&', $url->getUrl()));
199
    $more_form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&amp;', '&', $url->getUrl()));
200
    $tab_index = MORE_FORM_MOTIF_TAB;
200
    $tab_index = MORE_FORM_MOTIF_TAB;
201
    $more_squelette =& $more_form->defaultRenderer();
201
    $more_squelette =& $more_form->defaultRenderer();
202
    $more_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
202
    $more_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
203
    $more_squelette->setElementTemplate( '{label}'."\n".
203
    $more_squelette->setElementTemplate( '{label}'."\n".
204
                                    '{element}'."\n".
204
                                    '{element}'."\n".
205
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
205
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
206
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n");
206
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n");
207
    $more_form->accept($more_squelette);
207
    $more_form->accept($more_squelette);
208
    $more_form->removeAttribute('name');
208
    $more_form->removeAttribute('name');
209
    
209
    
210
    $partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n";
210
    $partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n";
211
    $more_form->addElement('html', $partie_menu_debut);
211
    $more_form->addElement('html', $partie_menu_debut);
212
    
212
    
213
    $id = 'more_motif';
213
    $id = 'more_motif';
214
    $aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'size' => MORE_FORM_MOTIF_SIZE, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH,
214
    $aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH,
215
                            'accesskey' => MORE_LG_FORM_ACCESSKEY, 'onclick' => "javascript: this.value='';");
215
                            'accesskey' => MORE_LG_FORM_ACCESSKEY, 'onclick' => "javascript: this.value='';");
216
    $label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>';
216
    $label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>';
217
    $more_form->addElement('text', $id, $label, $aso_attributs);
217
    $more_form->addElement('text', $id, $label, $aso_attributs);
218
    
218
    
219
    $id = 'more_ok';
219
    $id = 'more_ok';
220
    $aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
220
    $aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
221
    $more_form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs);
221
    $more_form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs);
222
    
222
    
223
    $partie_entete_fin = "\n".'</fieldset>';
223
    $partie_entete_fin = "\n".'</fieldset>';
224
    $more_form->addElement('html', $partie_entete_fin);
224
    $more_form->addElement('html', $partie_entete_fin);
225
    
225
    
226
    // Instanciation avec les valeur par défaut
226
    // Instanciation avec les valeur par défaut
227
    $more_form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']);
227
    $more_form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']);
228
    
228
    
229
    // Transformation en XHTML du formulaire
229
    // Transformation en XHTML du formulaire
230
    $retour .= $more_form->toHTML()."\n";
230
    $retour .= $more_form->toHTML()."\n";
231
    // --------------------------------------------------------------------------------------------------------
231
    // --------------------------------------------------------------------------------------------------------
232
    
232
    
233
    return $retour;
233
    return $retour;
234
}
234
}
235
 
235
 
236
// +------------------------------------------------------------------------------------------------------+
236
// +------------------------------------------------------------------------------------------------------+
237
// |                                            PIED du PROGRAMME                                         |
237
// |                                            PIED du PROGRAMME                                         |
238
// +------------------------------------------------------------------------------------------------------+
238
// +------------------------------------------------------------------------------------------------------+
239
 
239
 
240
 
240
 
241
/* +--Fin du code ----------------------------------------------------------------------------------------+
241
/* +--Fin du code ----------------------------------------------------------------------------------------+
242
*
242
*
243
* $Log: not supported by cvs2svn $
243
* $Log: not supported by cvs2svn $
-
 
244
* Revision 1.6  2005/05/25 13:49:22  jpm
-
 
245
* Corection erreur pour la recherche dans le contenu.
-
 
246
*
244
* Revision 1.5  2005/05/19 12:46:12  jpm
247
* Revision 1.5  2005/05/19 12:46:12  jpm
245
* Correction bogue accesskey.
248
* Correction bogue accesskey.
246
* Ajout d'un id à la liste.
249
* Ajout d'un id à la liste.
247
* Arrondissement des score.
250
* Arrondissement des score.
248
*
251
*
249
* Revision 1.4  2005/04/14 17:39:34  jpm
252
* Revision 1.4  2005/04/14 17:39:34  jpm
250
* Amélioration du moteur de rechercher :
253
* Amélioration du moteur de rechercher :
251
*  - pourcentage
254
*  - pourcentage
252
*  - ajout d'info
255
*  - ajout d'info
253
*
256
*
254
* Revision 1.3  2005/02/22 19:27:21  jpm
257
* Revision 1.3  2005/02/22 19:27:21  jpm
255
* Changement de nom de variables.
258
* Changement de nom de variables.
256
* Suppression de l'attribut nam de la balise form via une méthode de HTML_Common.
259
* Suppression de l'attribut nam de la balise form via une méthode de HTML_Common.
257
*
260
*
258
* Revision 1.2  2005/02/22 17:44:03  jpm
261
* Revision 1.2  2005/02/22 17:44:03  jpm
259
* Suppression de référence posant problème.
262
* Suppression de référence posant problème.
260
*
263
*
261
* Revision 1.1  2004/12/07 10:24:01  jpm
264
* Revision 1.1  2004/12/07 10:24:01  jpm
262
* Moteur de recherche version de départ.
265
* Moteur de recherche version de départ.
263
*
266
*
264
*
267
*
265
* +-- Fin du code ----------------------------------------------------------------------------------------+
268
* +-- Fin du code ----------------------------------------------------------------------------------------+
266
*/
269
*/
267
?>
270
?>