Subversion Repositories Sites.tela-botanica.org

Compare Revisions

Ignore whitespace Rev 719 → Rev 720

/trunk/papyrus/applettes/recherche_eflore/configuration/recherche_eflore_config.inc.php
1,60 → 1,62
<?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: synd_configuration.inc.php,v 1.2 2008-10-29 15:54:40 alexandre_tb Exp $
/**
* papyrus_bp - synd_configuration.inc.php
*
* Description :
*
*@package papyrus_bp
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 1999-2006
*@version $Revision: 1.2 $ $Date: 2008-10-29 15:54:40 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$GLOBALS['_R_Eflore_'] = array();
 
// Chemin vers les dossiers de l'applette
/** Chemin vers l'applette Recherche_evenements de Papyrus.*/
define('R_Eflore_CHEMIN_APPLETTE', GEN_CHEMIN_APPLETTE.'recherche_eflore'.GEN_SEP);
/** Chemin vers les fichiers de traduction de l'applette Syndication de Papyrus.*/
define('R_Eflore_CHEMIN_LANGUE', R_Eflore_CHEMIN_APPLETTE.'langues'.GEN_SEP);
/** Chemin vers les fichiers squelettes de l'applette Syndication de Papyrus.*/
define('R_Eflore_CHEMIN_SQUELETTE', R_Eflore_CHEMIN_APPLETTE.'squelettes'.GEN_SEP);
 
//Ecrire l'url du service puis le numéro du référentiel sous la forme : "http://url/||00"
$GLOBALS['_R_Eflore_']['flores'] = array ("France métropolitaine" => "http://www.tela-botanica.org/page:bdnff||25",
"Afrique du nord" => "http://www.tela-botanica.org/page:bdafn||45",
"Réunion" => "http://www.tela-botanica.org/page:bdnfm||29",
"Bryophites d'Europe" => "http://www.tela-botanica.org/page:bryophytes_europe||38") ;
 
 
?>
<?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: synd_configuration.inc.php,v 1.2 2008-10-29 15:54:40 alexandre_tb Exp $
/**
* papyrus_bp - synd_configuration.inc.php
*
* Description :
*
*@package papyrus_bp
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 1999-2006
*@version $Revision: 1.2 $ $Date: 2008-10-29 15:54:40 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$GLOBALS['_R_Eflore_'] = array();
 
// Chemin vers les dossiers de l'applette
/** Chemin vers l'applette Recherche_evenements de Papyrus.*/
define('R_Eflore_CHEMIN_APPLETTE', GEN_CHEMIN_APPLETTE.'recherche_eflore'.GEN_SEP);
/** Chemin vers les fichiers de traduction de l'applette Syndication de Papyrus.*/
define('R_Eflore_CHEMIN_LANGUE', R_Eflore_CHEMIN_APPLETTE.'langues'.GEN_SEP);
/** Chemin vers les fichiers squelettes de l'applette Syndication de Papyrus.*/
define('R_Eflore_CHEMIN_SQUELETTE', R_Eflore_CHEMIN_APPLETTE.'squelettes'.GEN_SEP);
/** Langue par défaut pour cette applette. */
define('R_Eflore_I18N_DEFAUT', 'fr');
 
//Ecrire l'url du service puis le numéro du référentiel sous la forme : "http://url/||00"
$GLOBALS['_R_Eflore_']['flores'] = array ("France métropolitaine" => "http://www.tela-botanica.org/page:bdnff||25",
"Afrique du nord" => "http://www.tela-botanica.org/page:bdafn||45",
"Réunion" => "http://www.tela-botanica.org/page:bdnfm||29",
"Bryophites d'Europe" => "http://www.tela-botanica.org/page:bryophytes_europe||38") ;
 
 
?>
/trunk/papyrus/applettes/recherche_eflore/recherche_eflore.php
1,155 → 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;
}
 
<?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_'.R_Eflore_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;
}
 
?>