Subversion Repositories Applications.papyrus

Rev

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

Rev 846 Rev 850
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.10 2006-05-19 10:04:55 jp_milcent Exp $
24
// CVS : $Id: moteur_recherche.php,v 1.11 2006-05-23 13:39:13 florian 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.10 $ $Date: 2006-05-19 10:04:55 $
41
*@version       $Revision: 1.11 $ $Date: 2006-05-23 13:39:13 $
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 du fichier de configuration des Spip.*/
56
/** Inclusion du fichier de configuration des Spip.*/
57
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_config_spip.inc.php';
57
require_once GEN_CHEMIN_APPLETTE.'moteur_recherche/configuration/more_config_spip.inc.php';
58
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
58
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
59
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
59
require_once MORE_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
60
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/
60
/** Inclusion de la bibliothèque PEAR de modification des squelettes des formulaires QuickForm.*/
61
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/Renderer/Default.php';
61
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/Renderer/Default.php';
62
 
62
 
63
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
63
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
64
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
64
if (file_exists(MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
65
    /** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
65
    /** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
66
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
66
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
67
} else {
67
} else {
68
    /** Inclusion du fichier de traduction par défaut.*/
68
    /** Inclusion du fichier de traduction par défaut.*/
69
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.MORE_I18N_DEFAUT.'.inc.php';
69
    require_once MORE_CHEMIN_LANGUE.'more_langue_'.MORE_I18N_DEFAUT.'.inc.php';
70
}
70
}
71
 
71
 
72
// +------------------------------------------------------------------------------------------------------+
72
// +------------------------------------------------------------------------------------------------------+
73
// |                                            CORPS du PROGRAMME                                        |
73
// |                                            CORPS du PROGRAMME                                        |
74
// +------------------------------------------------------------------------------------------------------+
74
// +------------------------------------------------------------------------------------------------------+
75
 
75
 
76
if (isset($_POST['more_motif']) && $_POST['more_motif'] != '') {
76
if (isset($_POST['more_motif']) && $_POST['more_motif'] != '') {
77
    // Initialisation de variable extérieures
77
    // Initialisation de variable extérieures
78
    $GLOBALS['_VEI_']['usurpation'] = MORE_LG_USURPATION.htmlentities(stripslashes($_POST['more_motif']));
78
    $GLOBALS['_VEI_']['usurpation'] = MORE_LG_USURPATION.htmlentities(stripslashes($_POST['more_motif']));
79
    $GLOBALS['_GEN_commun']['info_menu'] = null;
79
    $GLOBALS['_GEN_commun']['info_menu'] = null;
80
    $GLOBALS['_PAPYRUS_']['general']['application_chemin'] = null;
80
    $GLOBALS['_PAPYRUS_']['general']['application_chemin'] = null;
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
/** Fonction 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
    $url = $_GEN_commun['url'];
118
    $url = $_GEN_commun['url'];
119
    $url_base = PAP_URL;
119
    $url_base = PAP_URL;
120
    $url_id_type_site = GEN_URL_ID_TYPE_SITE;
120
    $url_id_type_site = GEN_URL_ID_TYPE_SITE;
121
    $indent_origine = 12;// Indentation de départ en nombre d'espace
121
    $indent_origine = 12;// Indentation de départ en nombre d'espace
122
    $indent_pas     = 4;// Pas d'indentation en nombre d'espace
122
    $indent_pas     = 4;// Pas d'indentation en nombre d'espace
123
    $retour = '';
123
    $retour = '';
124
    $retour_resultats = '';
124
    $retour_resultats = '';
125
    // Titre de la page
125
    // Titre de la page
-
 
126
    if (isset($_POST['more_motif'])) {
126
    $GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = MORE_LG_TITRE.htmlentities(stripslashes($_POST['more_motif']));
127
    	$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = MORE_LG_TITRE.htmlentities(stripslashes($_POST['more_motif']));
-
 
128
    }
127
    
129
    
128
    // --------------------------------------------------------------------------------------------------------
130
    // --------------------------------------------------------------------------------------------------------
129
    // Lancement de la recherche si nécessaire
131
    // Lancement de la recherche si nécessaire
130
    
132
    
131
    $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = '';
133
    $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = '';
132
    if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') {
134
    if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') {
133
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE;
135
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE;
134
    } else {
136
    } else {
135
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = $_POST['more_motif'];
137
        $_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = $_POST['more_motif'];
136
        /** Inclusion de la classe Recherche.*/
138
        /** Inclusion de la classe Recherche.*/
137
        require_once MORE_CHEMIN_BIBLIO.'more_recherche.class.php';
139
        require_once MORE_CHEMIN_BIBLIO.'more_recherche.class.php';
138
        /** Inclusion de la classe Recherche_Papyrus_Menu.*/
140
        /** Inclusion de la classe Recherche_Papyrus_Menu.*/
139
        require_once MORE_CHEMIN_BIBLIO.'more_recherche_papyrus_menu.class.php';
141
        require_once MORE_CHEMIN_BIBLIO.'more_recherche_papyrus_menu.class.php';
140
        /** Inclusion de la classe Recherche_Spip_Article.*/
142
        /** Inclusion de la classe Recherche_Spip_Article.*/
141
        require_once MORE_CHEMIN_BIBLIO.'more_recherche_spip_article.class.php';
143
        require_once MORE_CHEMIN_BIBLIO.'more_recherche_spip_article.class.php';
142
        $moteur = new Recherche($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
144
        $moteur = new Recherche($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
143
        $recherche_papyrus_menu = new Recherche_Papyrus_Menu($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
145
        $recherche_papyrus_menu = new Recherche_Papyrus_Menu($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
144
        $recherche_spip_article = new Recherche_Spip_Article($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
146
        $recherche_spip_article = new Recherche_Spip_Article($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif']);
145
        $moteur->ajouterRecherche($recherche_papyrus_menu);
147
        $moteur->ajouterRecherche($recherche_papyrus_menu);
146
        $moteur->ajouterRecherche($recherche_spip_article);
148
        $moteur->ajouterRecherche($recherche_spip_article);
147
        $aso_resultats = $moteur->rechercherMotif();
149
        $aso_resultats = $moteur->rechercherMotif();
148
        //$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($aso_resultats, true).'</pre>';
150
        //$GLOBALS['_DEBOGAGE_'] = '<pre>'.print_r($aso_resultats, true).'</pre>';
149
        $nbre_pages = count($aso_resultats);
151
        $nbre_pages = count($aso_resultats);
150
        if ($nbre_pages <= 1) {
152
        if ($nbre_pages <= 1) {
151
        	$retour_resultats .= '<h1>'.sprintf(MORE_LG_RESULTAT_TITRE, $nbre_pages).'</h1>'."\n";
153
        	$retour_resultats .= '<h1>'.sprintf(MORE_LG_RESULTAT_TITRE, $nbre_pages).'</h1>'."\n";
152
        } else {
154
        } else {
153
        	$retour_resultats .= '<h1>'.sprintf(MORE_LG_RESULTAT_TITRE_PLURIEL, $nbre_pages).'</h1>'."\n";
155
        	$retour_resultats .= '<h1>'.sprintf(MORE_LG_RESULTAT_TITRE_PLURIEL, $nbre_pages).'</h1>'."\n";
154
        }
156
        }
155
        if ($nbre_pages == 0) {
157
        if ($nbre_pages == 0) {
156
            $retour_resultats .= '<p class="information">'.MORE_LG_RESULTAT_VIDE.'</p>'."\n";
158
            $retour_resultats .= '<p class="information">'.MORE_LG_RESULTAT_VIDE.'</p>'."\n";
157
        } else {
159
        } else {
158
            $retour_resultats .= '<ul id="more_resultat">'."\n";
160
            $retour_resultats .= '<ul id="more_resultat">'."\n";
159
            foreach ($aso_resultats as $val) {
161
            foreach ($aso_resultats as $val) {
160
                if (!empty($val['url'])) {
162
                if (!empty($val['url'])) {
161
                    $retour_resultats .= '<li>'."\n";
163
                    $retour_resultats .= '<li>'."\n";
162
                    $retour_resultats .=    '<h2><a href="'.$val['url'].'" ';
164
                    $retour_resultats .=    '<h2><a href="'.$val['url'].'" ';
163
                    if ($val['hreflang'] != '') {
165
                    if ($val['hreflang'] != '') {
164
                        $retour_resultats .= 'hreflang="'.$val['hreflang'].'" ';
166
                        $retour_resultats .= 'hreflang="'.$val['hreflang'].'" ';
165
                    }
167
                    }
166
                    if ($val['accesskey'] != '') {
168
                    if ($val['accesskey'] != '') {
167
                        $retour_resultats .= 'accesskey="'.$val['accesskey'].'" ';
169
                        $retour_resultats .= 'accesskey="'.$val['accesskey'].'" ';
168
                    }
170
                    }
169
                    if ($val['title'] != '') {
171
                    if ($val['title'] != '') {
170
                        $retour_resultats .= 'title="'.$val['title'].'" ';
172
                        $retour_resultats .= 'title="'.$val['title'].'" ';
171
                    }
173
                    }
172
                    $retour_resultats .= '>'.$val['titre'].'</a></h2>';
174
                    $retour_resultats .= '>'.$val['titre'].'</a></h2>';
173
                    $retour_resultats .= '<dl>'."\n";
175
                    $retour_resultats .= '<dl>'."\n";
174
                    //if (trim($val['poids']) != '') {
176
                    //if (trim($val['poids']) != '') {
175
                    //    $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_POIDS.'</dt>'."\n";
177
                    //    $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_POIDS.'</dt>'."\n";
176
                    //    $retour_resultats .= '<dd>'.$val['poids'].'</dd>'."\n";
178
                    //    $retour_resultats .= '<dd>'.$val['poids'].'</dd>'."\n";
177
                    //}
179
                    //}
178
                    if (trim($val['score']) != '') {
180
                    if (trim($val['score']) != '') {
179
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_SCORE.'</dt>'."\n";
181
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_SCORE.'</dt>'."\n";
180
                        $retour_resultats .= '<dd>'.$val['score'].MORE_LG_RESULTAT_POURCENT.'</dd>'."\n";
182
                        $retour_resultats .= '<dd>'.$val['score'].MORE_LG_RESULTAT_POURCENT.'</dd>'."\n";
181
                    }
183
                    }
182
                    if (trim($val['date_creation']) != '') {
184
                    if (trim($val['date_creation']) != '') {
183
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DATE_CREATION.'</dt>'."\n";
185
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DATE_CREATION.'</dt>'."\n";
184
                        $retour_resultats .= '<dd>'.$val['date_creation'].'</dd>'."\n";
186
                        $retour_resultats .= '<dd>'.$val['date_creation'].'</dd>'."\n";
185
                    }
187
                    }
186
                    if (trim($val['description']) != '') {
188
                    if (trim($val['description']) != '') {
187
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DESCRIPTION.'</dt>'."\n";
189
                        $retour_resultats .= '<dt>'.MORE_LG_RESULTAT_DESCRIPTION.'</dt>'."\n";
188
                        $retour_resultats .= '<dd>'.$val['description'].'</dd>'."\n";
190
                        $retour_resultats .= '<dd>'.$val['description'].'</dd>'."\n";
189
                    }
191
                    }
190
                    $retour_resultats .= '</dl>'."\n";
192
                    $retour_resultats .= '</dl>'."\n";
191
                    $retour_resultats .= '</li>'."\n";
193
                    $retour_resultats .= '</li>'."\n";
192
                }
194
                }
193
            }
195
            }
194
            $retour_resultats .= '</ul>'."\n";
196
            $retour_resultats .= '</ul>'."\n";
195
        }
197
        }
196
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
198
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
197
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
199
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
198
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = $retour_resultats;
200
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = $retour_resultats;
199
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '';
201
        $GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '';
200
        $GLOBALS['_GEN_commun']['info_menu'] = '';
202
        $GLOBALS['_GEN_commun']['info_menu'] = '';
201
    }
203
    }
202
    
204
    
203
    // --------------------------------------------------------------------------------------------------------
205
    // --------------------------------------------------------------------------------------------------------
204
    // Création du formulaire de l'applette
206
    // Création du formulaire de l'applette
205
    
207
    
206
    // Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
208
    // Notes : Quickform semble remplacer les & des &amp; à nouveau par des &amp; solution utiliser str_replace()...
207
    $more_form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&amp;', '&', $url->getUrl()));
209
    $more_form = new HTML_QuickForm('form_more_recherche', 'post', str_replace('&amp;', '&', $url->getUrl()));
208
    $tab_index = MORE_FORM_MOTIF_TAB;
210
    $tab_index = MORE_FORM_MOTIF_TAB;
209
    $more_squelette =& $more_form->defaultRenderer();
211
    $more_squelette =& $more_form->defaultRenderer();
210
    $more_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
212
    $more_squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>');
211
    $more_squelette->setElementTemplate( '{label}'."\n".
213
    $more_squelette->setElementTemplate( '{label}'."\n".
212
                                    '{element}'."\n".
214
                                    '{element}'."\n".
213
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
215
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">'.MORE_LG_FORM_SYMBOLE_OBLIGATOIRE.'</span><!-- END required -->'."\n".
214
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n");
216
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n");
215
    $more_form->accept($more_squelette);
217
    $more_form->accept($more_squelette);
216
    $more_form->removeAttribute('name');
218
    $more_form->removeAttribute('name');
217
    
219
    
218
    $partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n";
220
    $partie_menu_debut = '<fieldset>'."\n".'<legend>'.MORE_LG_FORM_TITRE.'</legend>'."\n";
219
    $more_form->addElement('html', $partie_menu_debut);
221
    $more_form->addElement('html', $partie_menu_debut);
220
    
222
    
221
    $id = 'more_motif';
223
    $id = 'more_motif';
222
    $aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH,
224
    $aso_attributs = array( 'id'=>$id, 'tabindex' => $tab_index++, 'maxlength' => MORE_FORM_MOTIF_MAXLENGTH,
223
                            'accesskey' => MORE_LG_FORM_ACCESSKEY);
225
                            'accesskey' => MORE_LG_FORM_ACCESSKEY);
224
    $label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>';
226
    $label = '<label for="'.$id.'">'.MORE_LG_FORM_MOTIF.'</label>';
225
    $more_form->addElement('text', $id, $label, $aso_attributs);
227
    $more_form->addElement('text', $id, $label, $aso_attributs);
226
    
228
    
227
    $id = 'more_ok';
229
    $id = 'more_ok';
228
    $aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
230
    $aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
229
    $more_form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs);
231
    $more_form->addElement('submit', $id, MORE_LG_FORM_VALIDER, $aso_attributs);
230
    
232
    
231
    $partie_entete_fin = "\n".'</fieldset>';
233
    $partie_entete_fin = "\n".'</fieldset>';
232
    $more_form->addElement('html', $partie_entete_fin);
234
    $more_form->addElement('html', $partie_entete_fin);
233
    
235
    
234
    // Instanciation avec les valeur par défaut
236
    // Instanciation avec les valeur par défaut
235
    $more_form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']);
237
    $more_form->setDefaults($_SESSION['_MOTEUR_RECHERCHE_']['rechercher']);
236
    
238
    
237
    // Transformation en XHTML du formulaire
239
    // Transformation en XHTML du formulaire
238
    $retour .= $more_form->toHTML()."\n";
240
    $retour .= $more_form->toHTML()."\n";
239
    // --------------------------------------------------------------------------------------------------------
241
    // --------------------------------------------------------------------------------------------------------
240
    
242
    
241
    return $retour;
243
    return $retour;
242
}
244
}
243
 
245
 
244
// +------------------------------------------------------------------------------------------------------+
246
// +------------------------------------------------------------------------------------------------------+
245
// |                                            PIED du PROGRAMME                                         |
247
// |                                            PIED du PROGRAMME                                         |
246
// +------------------------------------------------------------------------------------------------------+
248
// +------------------------------------------------------------------------------------------------------+
247
 
249
 
248
 
250
 
249
/* +--Fin du code ----------------------------------------------------------------------------------------+
251
/* +--Fin du code ----------------------------------------------------------------------------------------+
250
*
252
*
251
* $Log: not supported by cvs2svn $
253
* $Log: not supported by cvs2svn $
-
 
254
* Revision 1.10  2006/05/19 10:04:55  jp_milcent
-
 
255
* Ajout d'un moteur de recherche analysant les articles des sites sous Spip.
-
 
256
*
252
* Revision 1.9  2006/04/28 12:41:49  florian
257
* Revision 1.9  2006/04/28 12:41:49  florian
253
* corrections erreurs chemin
258
* corrections erreurs chemin
254
*
259
*
255
* Revision 1.8  2006/03/02 10:49:49  ddelon
260
* Revision 1.8  2006/03/02 10:49:49  ddelon
256
* Fusion branche multilinguisme dans branche principale
261
* Fusion branche multilinguisme dans branche principale
257
*
262
*
258
* Revision 1.7.2.2  2005/12/27 15:56:00  ddelon
263
* Revision 1.7.2.2  2005/12/27 15:56:00  ddelon
259
* Fusion Head vers multilinguisme (wikini double clic)
264
* Fusion Head vers multilinguisme (wikini double clic)
260
*
265
*
261
* Revision 1.7.2.1  2005/12/20 14:40:25  ddelon
266
* Revision 1.7.2.1  2005/12/20 14:40:25  ddelon
262
* Fusion Head vers Livraison
267
* Fusion Head vers Livraison
263
*
268
*
264
* Revision 1.7  2005/09/27 09:07:32  ddelon
269
* Revision 1.7  2005/09/27 09:07:32  ddelon
265
* size applette et squelettes
270
* size applette et squelettes
266
*
271
*
267
* Revision 1.6  2005/05/25 13:49:22  jpm
272
* Revision 1.6  2005/05/25 13:49:22  jpm
268
* Corection erreur pour la recherche dans le contenu.
273
* Corection erreur pour la recherche dans le contenu.
269
*
274
*
270
* Revision 1.5  2005/05/19 12:46:12  jpm
275
* Revision 1.5  2005/05/19 12:46:12  jpm
271
* Correction bogue accesskey.
276
* Correction bogue accesskey.
272
* Ajout d'un id à la liste.
277
* Ajout d'un id à la liste.
273
* Arrondissement des score.
278
* Arrondissement des score.
274
*
279
*
275
* Revision 1.4  2005/04/14 17:39:34  jpm
280
* Revision 1.4  2005/04/14 17:39:34  jpm
276
* Amélioration du moteur de rechercher :
281
* Amélioration du moteur de rechercher :
277
*  - pourcentage
282
*  - pourcentage
278
*  - ajout d'info
283
*  - ajout d'info
279
*
284
*
280
* Revision 1.3  2005/02/22 19:27:21  jpm
285
* Revision 1.3  2005/02/22 19:27:21  jpm
281
* Changement de nom de variables.
286
* Changement de nom de variables.
282
* Suppression de l'attribut nam de la balise form via une méthode de HTML_Common.
287
* Suppression de l'attribut nam de la balise form via une méthode de HTML_Common.
283
*
288
*
284
* Revision 1.2  2005/02/22 17:44:03  jpm
289
* Revision 1.2  2005/02/22 17:44:03  jpm
285
* Suppression de référence posant problème.
290
* Suppression de référence posant problème.
286
*
291
*
287
* Revision 1.1  2004/12/07 10:24:01  jpm
292
* Revision 1.1  2004/12/07 10:24:01  jpm
288
* Moteur de recherche version de départ.
293
* Moteur de recherche version de départ.
289
*
294
*
290
*
295
*
291
* +-- Fin du code ----------------------------------------------------------------------------------------+
296
* +-- Fin du code ----------------------------------------------------------------------------------------+
292
*/
297
*/
293
?>
298
?>