Subversion Repositories Sites.tela-botanica.org

Compare Revisions

No changes between revisions

Ignore whitespace Rev 639 → Rev 640

/trunk/papyrus/applettes/recherche_eflore/recherche_eflore.php
New file
0,0 → 1,155
<?php
 
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of papyrus_bp. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: syndication.php,v 1.11 2008-10-29 15:55:56 alexandre_tb Exp $
/**
* papyrus_bp - syndication.php
*
* Description :
*
*@package papyrus_bp
//Auteur original :
*@author Grégoire Duché <gregoire@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 1999-2010
*@version $Revision: 0.01 $ $Date: 2008-10-29 15:55:56 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherRechercheEflore';
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Rr]echercheEflore'.
'(?:\s*'.
'(?:'.
'(url="[^"]*")|'.
'(titre="[^"]*")|'.
'(nb="?\d+"?)|'.
'(tailledesc="?\d+"?)|'.
'(id="[^"]*")|'.
'(nbmax="?\d+"?)|'.
'(nouvellefenetre="?(?:0|1)"?)|'.
'(formatdate="[^"]*")|'.
'(formatdatepro="[^"]*")|'.
'(template=".*")|'.
')'.
')+'.
'\s*\}\}';
 
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de cette application.*/
require_once GEN_CHEMIN_APPLETTE.'recherche_eflore'.GEN_SEP.'configuration'.GEN_SEP.'recherche_eflore_config.inc.php';
 
 
// Inclusion des fichiers de traduction de l'applette SYND de Papyrus
if (file_exists(R_Eflore_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
require_once R_Eflore_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
} else {
/** Inclusion du fichier de traduction par défaut.*/
require_once R_Eflore_CHEMIN_LANGUE.'synd_langue_'.SYND_I18N_DEFAUT.'.inc.php';
}
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Fonction afficherRechercheEvenement() - Affiche un formulaire renvoyant vers
*
* Cette fonction retourne la liste des pages des sites syndiqués.
*
* @param array contient les arguments de la fonction.
* @param array tableau global de Papyrus.
* @return string XHTML le formulaire de recherche dans Bazar.
*/
function afficherRechercheEflore($tab_applette_arguments, $_GEN_commun)
{
// Initialisation des variables
$sortie = '';
$string_arguments = "";
//+----------------------------------------------------------------------------------------------------------------+
// Gestion des arguments
$balise = $tab_applette_arguments[0];
$tab_arguments = $tab_applette_arguments;
unset($tab_arguments[0]);
foreach($tab_arguments as $argument) {
if ($argument != '') {
$string_arguments .= $argument;
$tab_parametres = explode('=', $argument, 2);
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
}
}
 
//
//+----------------------------------------------------------------------------------------------------------------+
// Gestion des erreurs de paramétrage
/*
* FIXME : mettre un template paramétré
* if (!isset($options['template'])) {
$options['template'] = SYND_CHEMIN_SQUELETTE.SYND_SQUELETTE_LISTE;
} else {
if (file_exists(SYND_CHEMIN_SQUELETTE.$options['template'])) {
$options['template'] = SYND_CHEMIN_SQUELETTE.$options['template'];
}
}*/
//+----------------------------------------------------------------------------------------------------------------+
// Gestion des squelettes
if (!isset($options['template'])) {
$options['template'] = R_Eflore_CHEMIN_SQUELETTE."defaut.tpl.html";
} else {
if (file_exists(R_Eflore_CHEMIN_SQUELETTE.$options['template'])) {
$options['template'] = R_Eflore_CHEMIN_SQUELETTE.$options['template'];
}
}
//Gestion des paramètres de flore (passé sous la forme : http://url/||00)
foreach ($GLOBALS['_R_Eflore_']['flores'] as $flore=>$chaine_valeur) {
unset($GLOBALS['_R_Eflore_']['flores'][$flore]);
$tab_valeur = explode("||", $chaine_valeur);
$tab_flore = array("nom" => $flore, "url" => str_replace("||", "?eflore_referentiel=", $chaine_valeur), "referentiel" => $tab_valeur[1]);
$GLOBALS['_R_Eflore_']['flores'][] = $tab_flore;
}
extract($GLOBALS['_R_Eflore_']);
// Demarre le buffer
ob_start();
// Inclusion du fichier
include($options['template']);
// Recuperer le contenu du buffer
$sortie = ob_get_contents();
// Arrete et detruit le buffer
ob_end_clean();
 
//+----------------------------------------------------------------------------------------------------------------+
// Sortie
return $sortie;
}
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property