Rev 176 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*vim: set expandtab tabstop=4 shiftwidth=4: */// +------------------------------------------------------------------------------------------------------+// | PHP version 4.3 |// +------------------------------------------------------------------------------------------------------+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |// +------------------------------------------------------------------------------------------------------+// | This file is part of eFlore-consultation. |// | |// | 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: eflore_fiche.inc.php,v 1.5 2005-07-26 09:20:40 jp_milcent Exp $/*** Affichage des fiches d'eFlore.** Ce script fournit le code html correspondant aux fiches d'eFlore.**@package eFlore//Auteur original :*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>//Autres auteurs :*@author Aucun*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.5 $ $Date: 2005-07-26 09:20:40 $// +------------------------------------------------------------------------------------------------------+*/// +------------------------------------------------------------------------------------------------------+// | ENTÊTE du PROGRAMME |// +------------------------------------------------------------------------------------------------------+// +------------------------------------------------------------------------------------------------------+// | CORPS du PROGRAMME |// +------------------------------------------------------------------------------------------------------+if (isset($_REQUEST['nn']) && $_REQUEST['nn'] != '') {// Récupération fiche -- onglet "Synthèse"if (isset($_REQUEST['nvp']) && $_REQUEST['nvp'] != '') {// Nous avons en plus un projet de sélectionné$contenu = file_get_contents(sprintf(EFLORE_URL_FICHE_SYNTHESE_PROJET, $_REQUEST['nn'], $_REQUEST['nvp']));} else {// Avec le projet par défaut (BDNFF)$contenu = file_get_contents(sprintf(EFLORE_URL_FICHE_SYNTHESE, $_REQUEST['nn']));}//Analyse du squeletterequire_once 'HTML/Template/ITX.php';$squelette = new HTML_Template_ITX();$squelette->setTemplate($contenu, FALSE, FALSE);// Gestion des niveaux taxonomiques supérieurs$squelette->setCallbackFunction('selectionnerEfloreRef', 'selectionnerEfloreRef');$squelette->performCallback();// Indique l'url pour obtenir fiche d'un nom$squelette->setCurrentBlock('corps');//http://testv4.tela-botanica.org/papyrus.php?site=5&menu=39&action=fiche&onglet=synthese&nn=1573$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_FICHE);$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ONGLET, EFLORE_LG_URL_ONGLET_SYNTHESE);$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NN, $_REQUEST['nn']);$squelette->setVariable('FormUrlProjetChangement', $GLOBALS['_EFLORE_']['url']->getURL());$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NVP, '');$squelette->setVariable('LienUrlProjetChangement', $GLOBALS['_EFLORE_']['url']->getURL());// Référentiel sélectionné par défaut$squelette->setCallbackFunction('NiveauTaxo', 'afficherNiveauTaxoSuperieur');$squelette->performCallback();$squelette->parseCurrentBlock('corps');// Récupère le bloc "corps"$sortie .= $squelette->get('corps');}// +------------------------------------------------------------------------------------------------------+// | LISTE des FONCTIONS |// +------------------------------------------------------------------------------------------------------+function afficherNiveauTaxoSuperieur($arguments) {$tab_nom_sup = array();$retour = '';$nt = $arguments[0];$nvp = $arguments[1];while ($nt != 0) {$aso_taxon = array();$contenu = file_get_contents(sprintf(EFLORE_URL_INFO_TAXON_SUP, rawurlencode($nt), rawurlencode($nvp)));preg_match("/<en_ce_r>(\d+)<\/en_ce_r>/", $contenu, $info);if (isset($info[1])) {$aso_taxon['nr'] = $info[1];$nr = $info[1];}preg_match('/<etr_id_t2>(\d+)<\/etr_id_t2>/', $contenu, $info);if (isset($info[1])) {$aso_taxon['nt'] = $info[1];$nt = $info[1];} else {$nt = 0;}preg_match('/<etr_id_vpt2>(\d+)<\/etr_id_vpt2>/', $contenu, $info);if (isset($info[1])) {$aso_taxon['nvp'] = $info[1];$nvp = $info[1];}preg_match('/<en_id_n>(\d+)<\/en_id_n>/', $contenu, $info);if (isset($info[1])) {$aso_taxon['nn'] = $info[1];}if ($nt != 0) {array_push($tab_nom_sup, $aso_taxon);}}// Nous avons des taxons supérieursif (count($tab_nom_sup) > 0) {$retour .= '<ul>'."\n";$j = 0;for($i = (count($tab_nom_sup)-1); $i >= 0; $i--) {$contenu = file_get_contents(sprintf(EFLORE_URL_INFO_NOM_LATIN, rawurlencode($tab_nom_sup[$i]['nn'])));preg_match("/<eni_in>(.+?)<\/eni_in>/", $contenu, $info);if (isset($info[1])) {$retour .= '<li>'.str_repeat(' ', ($j++ * 3)).$info[1].'</li>';} else {$retour .= '<li>'.str_repeat(' ', ($j++ * 3)).'???'.'</li>';}}$retour .= '</ul>'."\n";} else {$retour .= 'Aucun taxon supérieur ou information non renseignée.';}return $retour;}/* +--Fin du code ----------------------------------------------------------------------------------------+** $Log: not supported by cvs2svn $* Revision 1.4 2005/07/01 19:04:12 jp_milcent* Fin gestion des niveaux taxonomiques supérieurs.** Revision 1.3 2005/06/30 15:24:26 jpm* Début des modifications pour ajout de l'arborescence de la classif.** Revision 1.2 2005/06/24 09:46:43 jpm* Test pour mathilde** Revision 1.1 2005/01/28 19:48:11 jpm* Ajout d'une fiche de synthèse.** Revision 1.2 2005/01/03 19:44:40 jpm* Ajout de la gestion de l'action "fiche".** Revision 1.1 2004/12/23 20:05:17 jpm* Début prise en maine eflore-consultation.*** +-- Fin du code ----------------------------------------------------------------------------------------+*/?>