Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 172 | Rev 176 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
128 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.3                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eFlore-consultation.                                                            |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
173 jpm 24
// CVS : $Id: eflore_fiche.inc.php,v 1.3 2005-06-30 15:24:26 jpm Exp $
128 jpm 25
/**
26
* Affichage des fiches d'eFlore.
27
*
28
* Ce script fournit le code html correspondant aux fiches d'eFlore.
29
*
30
*@package eFlore
31
//Auteur original :
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
//Autres auteurs :
34
*@author        Aucun
35
*@copyright     Tela-Botanica 2000-2004
173 jpm 36
*@version       $Revision: 1.3 $ $Date: 2005-06-30 15:24:26 $
128 jpm 37
// +------------------------------------------------------------------------------------------------------+
38
*/
39
 
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTÊTE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
43
 
44
 
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                            CORPS du PROGRAMME                                        |
47
// +------------------------------------------------------------------------------------------------------+
48
if (isset($_REQUEST['nn']) && $_REQUEST['nn'] != '') {
49
    // Récupération fiche -- onglet "Synthèse"
50
    if (isset($_REQUEST['nvp']) && $_REQUEST['nvp'] != '') {
51
        // Nous avons en plus un projet de sélectionné
52
        $contenu = file_get_contents(sprintf(EFLORE_URL_FICHE_SYNTHESE_PROJET, $_REQUEST['nn'], $_REQUEST['nvp']));
53
    } else {
54
        // Avec le projet par défaut (BDNFF)
55
        $contenu = file_get_contents(sprintf(EFLORE_URL_FICHE_SYNTHESE, $_REQUEST['nn']));
56
    }
57
 
58
    //Analyse du squelette
173 jpm 59
    require_once 'HTML/Template/ITX.php';
60
    $squelette = new HTML_Template_ITX();
128 jpm 61
    $squelette->setTemplate($contenu, FALSE, FALSE);
62
 
173 jpm 63
    // Gestion des niveaux taxonomiques supérieurs
64
    $squelette->setCallbackFunction('selectionnerEfloreRef', 'selectionnerEfloreRef');
65
    $squelette->performCallback();
66
 
128 jpm 67
    // Indique l'url pour obtenir fiche d'un nom
68
    $squelette->setCurrentBlock('corps');
172 jpm 69
 
128 jpm 70
    //http://testv4.tela-botanica.org/papyrus.php?site=5&menu=39&action=fiche&onglet=synthese&nn=1573
71
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_FICHE);
72
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ONGLET, EFLORE_LG_URL_ONGLET_SYNTHESE);
73
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NN, $_REQUEST['nn']);
74
    $squelette->setVariable('FormUrlProjetChangement', $GLOBALS['_EFLORE_']['url']->getURL());
75
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NVP, '');
76
    $squelette->setVariable('LienUrlProjetChangement', $GLOBALS['_EFLORE_']['url']->getURL());
173 jpm 77
    // Référentiel sélectionné par défaut
78
    $squelette->setCallbackFunction('NiveauTaxo', 'afficherNiveauTaxoSuperieur');
79
    $squelette->performCallback();
128 jpm 80
    $squelette->parseCurrentBlock('corps');
81
 
82
    // Récupère le bloc "corps"
83
    $sortie .= $squelette->get('corps');
84
}
85
 
173 jpm 86
// +------------------------------------------------------------------------------------------------------+
87
// |                                            LISTE des FONCTIONS                                       |
88
// +------------------------------------------------------------------------------------------------------+
89
 
90
function afficherNiveauTaxoSuperieur($arguments) {
91
    $tab_nom_sup = array();
92
    $retour = '';
93
    $nt = $arguments[0];
94
    $nvp = $arguments[1];
95
    $nr = 1000;
96
    while ($nr != 0) {
97
        $aso_taxon = array();
98
        $contenu = file_get_contents(sprintf(EFLORE_URL_TAXON_SUP, rawurlencode($nt), rawurlencode($nvp)));
99
        preg_match('/<en_ce_r>(\d+)</en_ce_r>/', $contenu, $info);
100
        $aso_taxon['nr'] = $info[1];
101
        $retour .= 'ici'.$aso_taxon['nr'];
102
        $nr = $info[1];
103
        preg_match('/<etr_id_t2>(\d+)</etr_id_t2>/', $contenu, $info);
104
        $aso_taxon['nt'] = $info[1];
105
        $nt = $info[1];
106
        preg_match('/<etr_id_vpt2>(\d+)</etr_id_vpt2>/', $contenu, $info);
107
        $aso_taxon['nvp'] = $info[1];
108
        $nvp = $info[1];
109
        preg_match('/<en_id_n>(\d+)</en_id_n>/', $contenu, $info);
110
        $aso_taxon['nn'] = $info[1];
111
        array_push($tab_nom_sup, $aso_taxon);
112
    }
113
    $retour .= '<ul>';
114
    $j = 0;
115
    for($i = count($tab_nom_sup); $i > 0; $i--) {
116
        $retour .= '<li>'.str_repeat('&nbsp;', $j++).$tab_nom_sup[$i]['nn'].'</li>';
117
    }
118
    $retour .= '</ul>';
119
    return $retour;
120
}
128 jpm 121
/* +--Fin du code ----------------------------------------------------------------------------------------+
122
*
123
* $Log: not supported by cvs2svn $
173 jpm 124
* Revision 1.2  2005/06/24 09:46:43  jpm
125
* Test pour mathilde
126
*
172 jpm 127
* Revision 1.1  2005/01/28 19:48:11  jpm
128
* Ajout d'une fiche de synthèse.
129
*
128 jpm 130
* Revision 1.2  2005/01/03 19:44:40  jpm
131
* Ajout de la gestion de l'action "fiche".
132
*
133
* Revision 1.1  2004/12/23 20:05:17  jpm
134
* Début prise en maine eflore-consultation.
135
*
136
*
137
* +-- Fin du code ----------------------------------------------------------------------------------------+
138
*/
139
?>