641 |
gduche |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
4 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
5 |
// | PHP version 5.1 |
|
|
|
6 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
7 |
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
8 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
9 |
// | This file is part of papyrus_bp. |
|
|
|
10 |
// | |
|
|
|
11 |
// | Foobar is free software; you can redistribute it and/or modify |
|
|
|
12 |
// | it under the terms of the GNU General Public License as published by |
|
|
|
13 |
// | the Free Software Foundation; either version 2 of the License, or |
|
|
|
14 |
// | (at your option) any later version. |
|
|
|
15 |
// | |
|
|
|
16 |
// | Foobar is distributed in the hope that it will be useful, |
|
|
|
17 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
18 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
19 |
// | GNU General Public License for more details. |
|
|
|
20 |
// | |
|
|
|
21 |
// | You should have received a copy of the GNU General Public License |
|
|
|
22 |
// | along with Foobar; if not, write to the Free Software |
|
|
|
23 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
24 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
25 |
// CVS : $Id: syndication.php,v 1.11 2008-10-29 15:55:56 alexandre_tb Exp $
|
|
|
26 |
/**
|
|
|
27 |
* papyrus_bp - syndication.php
|
|
|
28 |
*
|
|
|
29 |
* Description :
|
|
|
30 |
*
|
|
|
31 |
*@package papyrus_bp
|
|
|
32 |
//Auteur original :
|
|
|
33 |
*@author Grégoire Duché <gregoire@tela-botanica.org>
|
|
|
34 |
//Autres auteurs :
|
|
|
35 |
*@author Aucun
|
|
|
36 |
*@copyright Tela-Botanica 1999-2010
|
|
|
37 |
*@version $Revision: 0.01 $ $Date: 2008-10-29 15:55:56 $
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
*/
|
|
|
40 |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
// | ENTÊTE du PROGRAMME |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherRechercheEvenement';
|
|
|
45 |
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Rr]echercheEvenements'.
|
|
|
46 |
'(?:\s*'.
|
|
|
47 |
'(?:'.
|
|
|
48 |
'(url="[^"]*")|'.
|
|
|
49 |
'(titre="[^"]*")|'.
|
|
|
50 |
'(nb="?\d+"?)|'.
|
|
|
51 |
'(tailledesc="?\d+"?)|'.
|
|
|
52 |
'(id="[^"]*")|'.
|
|
|
53 |
'(nbmax="?\d+"?)|'.
|
|
|
54 |
'(nouvellefenetre="?(?:0|1)"?)|'.
|
|
|
55 |
'(formatdate="[^"]*")|'.
|
|
|
56 |
'(formatdatepro="[^"]*")|'.
|
|
|
57 |
'(template=".*")|'.
|
|
|
58 |
')'.
|
|
|
59 |
')+'.
|
|
|
60 |
'\s*\}\}';
|
|
|
61 |
|
|
|
62 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
63 |
/** Inclusion du fichier de configuration de cette application.*/
|
|
|
64 |
require_once GEN_CHEMIN_APPLETTE.'recherche_evenements'.GEN_SEP.'configuration'.GEN_SEP.'recherche_evenement_config.inc.php';
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
// Inclusion des fichiers de traduction de l'applette SYND de Papyrus
|
|
|
68 |
if (file_exists(R_EVTS_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
|
|
|
69 |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
|
|
|
70 |
require_once R_EVTS_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
|
|
|
71 |
} else {
|
|
|
72 |
/** Inclusion du fichier de traduction par défaut.*/
|
|
|
73 |
require_once R_EVTS_CHEMIN_LANGUE.'synd_langue_'.SYND_I18N_DEFAUT.'.inc.php';
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
77 |
// | CORPS du PROGRAMME |
|
|
|
78 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
79 |
/** Fonction afficherRechercheEvenement() - Affiche un formulaire renvoyant vers
|
|
|
80 |
*
|
|
|
81 |
* Cette fonction retourne la liste des pages des sites syndiqués.
|
|
|
82 |
*
|
|
|
83 |
* @param array contient les arguments de la fonction.
|
|
|
84 |
* @param array tableau global de Papyrus.
|
|
|
85 |
* @return string XHTML le formulaire de recherche dans Bazar.
|
|
|
86 |
*/
|
|
|
87 |
function afficherRechercheEvenement($tab_applette_arguments, $_GEN_commun)
|
|
|
88 |
{
|
|
|
89 |
// Initialisation des variables
|
|
|
90 |
$sortie = '';
|
|
|
91 |
$string_arguments = "";
|
|
|
92 |
|
|
|
93 |
//+----------------------------------------------------------------------------------------------------------------+
|
|
|
94 |
// Gestion des arguments
|
|
|
95 |
$balise = $tab_applette_arguments[0];
|
|
|
96 |
$tab_arguments = $tab_applette_arguments;
|
|
|
97 |
|
|
|
98 |
unset($tab_arguments[0]);
|
|
|
99 |
foreach($tab_arguments as $argument) {
|
|
|
100 |
if ($argument != '') {
|
|
|
101 |
$string_arguments .= $argument;
|
|
|
102 |
$tab_parametres = explode('=', $argument, 2);
|
|
|
103 |
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
|
|
|
104 |
}
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
//
|
|
|
108 |
//+----------------------------------------------------------------------------------------------------------------+
|
|
|
109 |
// Gestion des erreurs de paramétrage
|
|
|
110 |
/*
|
|
|
111 |
* FIXME : mettre un template paramétré
|
|
|
112 |
* if (!isset($options['template'])) {
|
|
|
113 |
$options['template'] = SYND_CHEMIN_SQUELETTE.SYND_SQUELETTE_LISTE;
|
|
|
114 |
} else {
|
|
|
115 |
if (file_exists(SYND_CHEMIN_SQUELETTE.$options['template'])) {
|
|
|
116 |
$options['template'] = SYND_CHEMIN_SQUELETTE.$options['template'];
|
|
|
117 |
}
|
|
|
118 |
}*/
|
|
|
119 |
|
|
|
120 |
//+----------------------------------------------------------------------------------------------------------------+
|
|
|
121 |
// Gestion des squelettes
|
|
|
122 |
if (!isset($options['template'])) {
|
|
|
123 |
$options['template'] = R_EVTS_CHEMIN_SQUELETTE."defaut.tpl.html";
|
|
|
124 |
} else {
|
|
|
125 |
if (file_exists(R_EVTS_CHEMIN_SQUELETTE.$options['template'])) {
|
|
|
126 |
$options['template'] = R_EVTS_CHEMIN_SQUELETTE.$options['template'];
|
|
|
127 |
}
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
extract($GLOBALS['_R_EVTS_']);
|
|
|
131 |
// Demarre le buffer
|
|
|
132 |
ob_start();
|
|
|
133 |
// Inclusion du fichier
|
|
|
134 |
include($options['template']);
|
|
|
135 |
// Recuperer le contenu du buffer
|
|
|
136 |
$sortie = ob_get_contents();
|
|
|
137 |
// Arrete et detruit le buffer
|
|
|
138 |
ob_end_clean();
|
|
|
139 |
|
|
|
140 |
//+----------------------------------------------------------------------------------------------------------------+
|
|
|
141 |
// Sortie
|
|
|
142 |
return $sortie;
|
|
|
143 |
}
|
|
|
144 |
|
|
|
145 |
?>
|