Subversion Repositories Sites.tela-botanica.org

Rev

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

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