Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 136 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
123 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.0.3                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eRibo.                                                                          |
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
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: formulaire_taxonomique_xhtml.php,v 1.1 2005-01-28 19:45:44 jpm Exp $
25
/**
26
* Vue affichant le formulaire de recherche taxonomique.
27
*
28
* Permet de retourner le xhtml correspondant au formulaire de recherche taxonomique.
29
*
30
*@package eFlore
31
*@subpackage Vues
32
//Auteur original :
33
*@author        Frédéric LEGENS <flegens@free.fr>
34
//Autres auteurs :
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@copyright     Tela-Botanica 2000-2004
37
*@version       $Revision: 1.1 $ $Date: 2005-01-28 19:45:44 $
38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
45
$GLOBALS['alphabet'] = array();
46
 
47
// +------------------------------------------------------------------------------------------------------+
48
// |                                            CLASSE de la VUE                                          |
49
// +------------------------------------------------------------------------------------------------------+
50
class formulaire_taxonomique_xhtml implements iVue {
51
 
52
    protected $leBlock;
53
 
54
    function __construct($unBlock)
55
    {
56
        $this->leBlock = $unBlock;
57
    }
58
 
59
    function serialiser()
60
    {
61
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
62
        $retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
63
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
64
 
65
        $retour .= '<head>'."\n";
66
        $retour .= '<!-- BEGIN entete -->'."\n";
67
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
68
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
69
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
70
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
71
        $retour .= '<title>Liste de noms latins</title>'."\n";
72
        $retour .= '<!-- END entete -->'."\n";
73
        $retour .= '</head>'."\n";
74
 
75
        $retour .= '<body>'."\n";
76
        $retour .= '<!-- BEGIN corps -->'."\n";
77
        $retour .= '<h2>'.'Rechercher par taxon'.'</h2>'."\n";
78
        $retour .= '<form id="eflore_form_taxonomie" name="eflore_form_taxonomie" action="{UrlProjetTaxon}" method="post">'."\n";
79
        $retour .= '<fieldset>'."\n".'<legend>'.'Recherche par taxon'.'</legend>'."\n";
80
        $retour .= '<p>'."\n";
81
        $retour .= '<label for="eflore_projet">'.'Projet : '.'</label>'."\n";
82
        $retour .= '<select id="eflore_projet" name="eflore_projet">'."\n";
83
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE>PROJET_VERSION','afficherProjets');
84
        $retour .= '</select>'."\n";
85
        $retour .= '<label for="eflore_ordre">'.'afficher les taxons '.'</label>'."\n";
86
        $retour .= '<select id="eflore_ordre" name="eflore_ordre">'."\n";
87
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE','afficherOrdre');
88
        $retour .= '</select>'."\n";
89
        $retour .= '<label for="eflore_rang">'.'au rang :'.'</label>'."\n";
90
        $retour .= '<select id="eflore_rang" name="eflore_rang">'."\n";
91
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE','afficherRang');
92
        $retour .= '</select>'."\n";
93
        $retour .= '<input type="submit" value="'.'OK'.'" />'."\n";
94
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE>TAXON_RECHERCHE','creerAlphabetTaxon');
95
        $retour .= afficherAlphabetTaxon();
96
        $retour .= '</p>'."\n";
97
        $retour .= '</fieldset>'."\n";
98
        $retour .= '</form>'."\n";
99
        $retour .= '<!-- END corps -->'."\n";
100
        $retour .= '</body>'."\n";
101
        $retour .= '</html>'."\n";
102
 
103
        // Envoi au navigateur après encodage en entité des caractères posant problème
104
        echo remplaceEntiteHTLM($retour);
105
    }
106
}
107
 
108
// +------------------------------------------------------------------------------------------------------+
109
// |                                            LISTE des FONCTIONS                                       |
110
// +------------------------------------------------------------------------------------------------------+
111
function afficherProjets($donnees)
112
{
113
    if ($donnees['eprv_id_version'] == $donnees['evp']) {
114
        $retour .= '  <option value="'.$donnees['eprv_id_version'].'" selected="selected">';
115
    } else {
116
        $retour .= '  <option value="'.$donnees['eprv_id_version'].'">';
117
    }
118
    $retour .= $donnees['eprv_nom'].' - '.$donnees['epr_intitule_projet'];
119
    $retour .= '</option>'."\n";
120
    return $retour;
121
}
122
 
123
function creerAlphabetTaxon($donnees)
124
{
125
    $chaine = '';
126
    if (!empty($donnees['eni_intitule_nom'])) {
127
        $chaine = $donnees['eni_intitule_nom'];
128
    }
129
    if (isset($chaine{0}) AND !isset($GLOBALS['alphabet'][$chaine{0}])) {
130
        $GLOBALS['alphabet'][$chaine{0}] = $chaine{0};
131
    }
132
}
133
 
134
function afficherAlphabetTaxon()
135
{
136
    $retour = '';
137
    if (count($GLOBALS['alphabet']) != 0) {
138
        $retour .= '</p>'."\n";
139
        $retour .= '<p>'."\n";
140
        foreach ($GLOBALS['alphabet'] as $cle) {
141
            $retour .= '<input id="eflore_lettre" name="eflore_lettre" type="submit" value="'.ucfirst($cle).'" />'."\n";
142
        }
143
        $retour .= '<input id="eflore_lettre" name="eflore_lettre" type="submit" value="'.'TOUS'.'" />'."\n";
144
    }
145
    return $retour;
146
}
147
 
148
function afficherOrdre($donnees)
149
{
150
    $retour = '';
151
    $selected_sup = '';
152
    $selected_ega = '';
153
    $selected_inf = '';
154
    $selected = 'selected="selected"';
155
    switch ($donnees['od']) {
156
        case 'sup':
157
            $selected_sup = $selected;
158
            break;
159
        case 'ega':
160
            $selected_ega = $selected;
161
            break;
162
        case 'inf':
163
            $selected_inf = $selected;
164
            break;
165
    }
166
    $retour .= '<option value="sup" '.$selected_sup.'>'.'Supérieur'.'</option>'."\n";
167
    $retour .= '<option value="ega" '.$selected_ega.'>'.'Égal'.'</option>'."\n";
168
    $retour .= '<option value="inf" '.$selected_inf.'>'.'Inférieur'.'</option>'."\n";
169
    return $retour;
170
}
171
 
172
function afficherRang($donnees)
173
{
174
    $retour = '';
175
    $selected_120 = '';
176
    $selected_160 = '';
177
    $selected_250 = '';
178
    $selected_280 = '';
179
    $selected = 'selected="selected"';
180
    switch ($donnees['rg']) {
181
        case 120:
182
            $selected_120 = $selected;
183
            break;
184
        case 160:
185
            $selected_160 = $selected;
186
            break;
187
        case 250:
188
            $selected_250 = $selected;
189
            break;
190
        case 280:
191
            $selected_280 = $selected;
192
            break;
193
    }
194
    $retour .= '<option value="120" '.$selected_120.'>'.'Famille'.'</option>'."\n";
195
    $retour .= '<option value="160" '.$selected_160.'>'.'Genre'.'</option>'."\n";
196
    $retour .= '<option value="250" '.$selected_250.'>'.'Espèce'.'</option>'."\n";
197
    $retour .= '<option value="280" '.$selected_280.'>'.'Sous-Espèce'.'</option>'."\n";
198
    return $retour;
199
}
200
 
201
// +------------------------------------------------------------------------------------------------------+
202
// |                                            PIED du PROGRAMME                                         |
203
// +------------------------------------------------------------------------------------------------------+
204
 
205
 
206
/* +--Fin du code ----------------------------------------------------------------------------------------+
207
*
208
* $Log: not supported by cvs2svn $
209
* Revision 1.1  2005/01/26 10:45:33  jpm
210
* Ajout des résultats de recherche par noms vernaculaires.
211
*
212
*
213
* +-- Fin du code ----------------------------------------------------------------------------------------+
214
*/
215
?>