Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev Author Line No. Line
59 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
// +------------------------------------------------------------------------------------------------------+
127 jpm 24
// CVS : $Id: eflore_recherche_taxonomie.inc.php,v 1.2 2005-01-28 19:47:55 jpm Exp $
59 jpm 25
/**
26
* Affichage du moteur de recherche taxonomique et de ses résultats.
27
*
28
* Ce script fournit le code html correspondant aux moteurs de recherche taxonomique (par projet) et ses
29
* résultats.
30
*
31
*@package eFlore
32
//Auteur original :
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
34
//Autres auteurs :
35
*@author        Aucun
36
*@copyright     Tela-Botanica 2000-2004
127 jpm 37
*@version       $Revision: 1.2 $ $Date: 2005-01-28 19:47:55 $
59 jpm 38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTÊTE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
44
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CORPS du PROGRAMME                                        |
48
// +------------------------------------------------------------------------------------------------------+
127 jpm 49
// Recherche sur les noms scientifiques
50
if (isset($_REQUEST['eflore_projet']) AND isset($_REQUEST['eflore_rang']) AND isset($_REQUEST['eflore_ordre'])) {
51
    if (!isset($_REQUEST['eflore_lettre'])) {
52
        $_REQUEST['eflore_lettre'] = 'A';
53
    }
54
    $url = sprintf(EFLORE_URL_FORM_TAXON_ALPHABET, rawurlencode($_REQUEST['eflore_projet']), rawurlencode($_REQUEST['eflore_rang']), rawurlencode($_REQUEST['eflore_ordre']), rawurlencode($_REQUEST['eflore_lettre']));
55
} else {
56
    $url = EFLORE_URL_FORM_TAXON;
57
}
58
$contenu = file_get_contents($url);
59 jpm 59
 
127 jpm 60
//Analyse du squelette
61
require_once 'HTML/Template/IT.php';
62
$squelette = new HTML_Template_IT();
63
$squelette->setTemplate($contenu, FALSE, FALSE);
64
 
65
// Indique l'url pour obtenir fiche d'un nom
66
$squelette->setCurrentBlock('corps');
67
// Ajout du paramêtre action à l'url courante.
68
$GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_RECH_TAX);
69
$squelette->setVariable('UrlProjetTaxon', $GLOBALS['_EFLORE_']['url']->getURL());
70
$GLOBALS['_EFLORE_']['url']->removeQueryString(EFLORE_LG_URL_ACTION);
71
$squelette->parseCurrentBlock('corps');
72
 
73
// Récupère le bloc "corps"
74
$sortie .= $squelette->get('corps');
75
 
76
// --------------------------------------------------------------------------------------------------------
77
// Lancement de la recherche
78
if (isset($_REQUEST['eflore_lettre'])) {
79
    // Recherche sur les noms scientifiques
80
    $url = sprintf(EFLORE_URL_LISTE_TAXON, rawurlencode($_REQUEST['eflore_projet']), rawurlencode($_REQUEST['eflore_rang']), rawurlencode($_REQUEST['eflore_ordre']), rawurlencode($_REQUEST['eflore_lettre']));
81
    $contenu = file_get_contents($url);
82
 
83
    //Analyse du squelette
84
    require_once 'HTML/Template/IT.php';
85
    $squelette = new HTML_Template_IT();
86
    $squelette->setTemplate($contenu, FALSE, FALSE);
87
 
88
    // Indique l'url pour obtenir fiche d'un nom
89
    $squelette->setCurrentBlock('corps');
90
    // Ajout du paramêtre action à l'url courante.
91
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ACTION, EFLORE_LG_URL_ACTION_FICHE);
92
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_ONGLET, EFLORE_LG_URL_ONGLET_SYNTHESE);
93
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NN, '');
94
    $squelette->setVariable('UrlFicheNom', $GLOBALS['_EFLORE_']['url']->getURL());
95
    $GLOBALS['_EFLORE_']['url']->removeQueryString(EFLORE_LG_URL_NN);
96
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_NVP, $_REQUEST['eflore_projet']);
97
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_RG, $_REQUEST['eflore_rang']);
98
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_OD, $_REQUEST['eflore_ordre']);
99
    $GLOBALS['_EFLORE_']['url']->addQueryString(EFLORE_LG_URL_LE, '');
100
    $squelette->setVariable('UrlRechercheTaxonAlphabet', $GLOBALS['_EFLORE_']['url']->getURL());
101
    $squelette->parseCurrentBlock('corps');
102
 
103
    // Récupère le bloc "corps"
104
    $sortie .= $squelette->get('corps');
105
}
106
 
59 jpm 107
/* +--Fin du code ----------------------------------------------------------------------------------------+
108
*
109
* $Log: not supported by cvs2svn $
127 jpm 110
* Revision 1.1  2004/12/23 20:05:17  jpm
111
* Début prise en maine eflore-consultation.
59 jpm 112
*
127 jpm 113
*
59 jpm 114
* +-- Fin du code ----------------------------------------------------------------------------------------+
115
*/
116
?>