Line 45... |
Line 45... |
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'] = '(?:<!-- '.$GLOBALS['_GEN_commun']['balise_prefixe'].'(MOTEUR_RECHERCHE) -->|'.
|
49 |
$GLOBALS['_GEN_commun']['info_applette_balise'] = '(?:<!-- '.$GLOBALS['_GEN_commun']['balise_prefixe'].'(MOTEUR_RECHERCHE) -->|'.
|
50 |
'\{\{[[Mm]oteurRecherche\s*\}\})';
|
50 |
'\{\{[[Mm]oteurRecherche'.
|
- |
|
51 |
'(?:\s*'.
|
- |
|
52 |
'(?:'.
|
- |
|
53 |
'(url="[^"]*")|'.
|
- |
|
54 |
')'.
|
- |
|
55 |
')+'.
|
- |
|
56 |
'\s*\}\})';
|
Line 51... |
Line 57... |
51 |
|
57 |
|
52 |
// --------------------------------------------------------------------------------------------------------
|
58 |
// --------------------------------------------------------------------------------------------------------
|
53 |
//Utilisation de la biblioth�que Papyrus pap_meta.fonct.php inclue par Papyrus
|
59 |
//Utilisation de la biblioth�que Papyrus pap_meta.fonct.php inclue par Papyrus
|
54 |
//Utilisation de la biblioth�que PEAR NET_URL inclue par Papyrus
|
60 |
//Utilisation de la biblioth�que PEAR NET_URL inclue par Papyrus
|
Line 107... |
Line 113... |
107 |
* @param array tableau global de Papyrus.
|
113 |
* @param array tableau global de Papyrus.
|
108 |
* @return string formulaire XHTML de recherche.
|
114 |
* @return string formulaire XHTML de recherche.
|
109 |
*/
|
115 |
*/
|
110 |
function afficherMoteurRecherche($tab_applette_arguments, $_GEN_commun)
|
116 |
function afficherMoteurRecherche($tab_applette_arguments, $_GEN_commun)
|
111 |
{
|
117 |
{
|
- |
|
118 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
119 |
// Gestion des arguments
|
- |
|
120 |
$balise = $tab_applette_arguments[0];
|
- |
|
121 |
$tab_arguments = $tab_applette_arguments;
|
- |
|
122 |
unset($tab_arguments[0]);
|
- |
|
123 |
foreach($tab_arguments as $argument) {
|
- |
|
124 |
if ($argument != '') {
|
- |
|
125 |
$tab_parametres = explode('=', $argument, 2);
|
- |
|
126 |
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
|
- |
|
127 |
}
|
- |
|
128 |
}
|
- |
|
129 |
|
112 |
// --------------------------------------------------------------------------------------------------------
|
130 |
// --------------------------------------------------------------------------------------------------------
|
113 |
// Initialisation de variable de configuration.
|
131 |
// Initialisation de variable de configuration.
|
114 |
$liste_type_site = '102, 103';// Les id des types des sites pouvant appara�tre dans le s�lecteur
|
132 |
$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.
|
133 |
$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
|
134 |
$GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] =& $_GEN_commun['pear_db'];// Connexion � la BD de Papyrus
|
Line 125... |
Line 143... |
125 |
|
143 |
|
126 |
// --------------------------------------------------------------------------------------------------------
|
144 |
// --------------------------------------------------------------------------------------------------------
|
127 |
// Lancement de la recherche si n�cessaire
|
145 |
// Lancement de la recherche si n�cessaire
|
128 |
$aso_squelette = array('formulaire' => MORE_FORM_SQUELETTE);
|
146 |
$aso_squelette = array('formulaire' => MORE_FORM_SQUELETTE);
|
- |
|
147 |
$_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = '';
|
- |
|
148 |
|
- |
|
149 |
//Greg : gestion d'une url personnalisée passée en paramètres url=""
|
129 |
$_SESSION['_MOTEUR_RECHERCHE_']['rechercher']['more_motif'] = '';
|
150 |
if (!isset($options['url'])) {
|
- |
|
151 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['form_url'] = $url->getUrl();
|
- |
|
152 |
} else {
|
- |
|
153 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['form_url'] = $options['url'];
|
- |
|
154 |
}
|
130 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['form_url'] = $url->getUrl();
|
155 |
|
131 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['form_tab'] = MORE_FORM_MOTIF_TAB;
|
156 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['form_tab'] = MORE_FORM_MOTIF_TAB;
|
132 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['more_motif_base'] = MORE_LG_FORM_MOTIF_VALUE;
|
157 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['more_motif_base'] = MORE_LG_FORM_MOTIF_VALUE;
|
133 |
if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') {
|
158 |
if (!isset($_POST['more_motif']) || $_POST['more_motif'] == '') {
|
134 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE;
|
159 |
$GLOBALS['_MOTEUR_RECHERCHE_']['formulaire']['more_motif'] = MORE_LG_FORM_MOTIF_VALUE;
|