Subversion Repositories eFlore/Archives.eflore-consultation-v1

Rev

Rev 11 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Integrateur eFlore.                                                             |
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
// +------------------------------------------------------------------------------------------------------+
12 jp_milcent 24
// CVS : $Id: eflore_affichage_xhtml.fonct.php,v 1.4 2006-11-09 18:13:03 jp_milcent Exp $
2 jpm 25
/**
26
* Fonctions pour l'affichage XHTML.
27
*
28
*@package eFlore
29
*@subpackage Ancien
30
//Auteur original :
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
//Autres auteurs :
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2005
12 jp_milcent 35
*@version       $Revision: 1.4 $ $Date: 2006-11-09 18:13:03 $
2 jpm 36
// +------------------------------------------------------------------------------------------------------+
37
*/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
42
 
43
/**
44
* Gestion des messages d'alerte.
45
*
46
*Cette fonction retourne un message d'alerte en html.
47
*
48
* @return string
49
*/
50
function message_alerte($type_message)
51
{
52
    $message_renvoyer="";
53
 
54
    switch ($type_message){
55
        case '01' :
5 jpm 56
            $message_renvoyer = inclusion_html('debut_ligne_alerte').
57
                                "Veuillez saisir un radical avant d'effectuer la recherche !".
58
                                inclusion_html('fin_ligne_alerte');
2 jpm 59
            break;
60
        case '02' :
5 jpm 61
            $message_renvoyer = inclusion_html('debut_ligne_alerte').
62
                                "Veuillez saisir un radical contenant au moins 3 caract&egrave;res alphab&eacute;tiques !".
63
                                inclusion_html("fin_ligne_alerte");
2 jpm 64
            break;
65
        case '03' :
5 jpm 66
            $message_renvoyer = inclusion_html('debut_ligne_alerte').
67
                                "Le symbole % ne peut pas être utilis&eacute; sans au moins trois caract&egrave;res alphab&eacute;tiques !".
68
                                inclusion_html('fin_ligne_alerte');
2 jpm 69
            break;
70
        case '04' :
5 jpm 71
            $message_renvoyer = inclusion_html('debut_ligne_alerte').
72
                                "Les symboles suivant ne doivent pas &ecirc;tre utilis&eacute;s : & < > \" ".
73
                                inclusion_html('fin_ligne_alerte');
2 jpm 74
            break;
75
    }//fin du switch
76
    return $message_renvoyer;
77
}
78
 
79
/**
80
* Gestion des inclusions html dans le code php.
81
*
82
*Cette fonction retourne du html à insérer dans le php.
83
*
84
* @return string
85
*/
86
function inclusion_html($type_inclusion)
87
{
88
    global $alerte, $flore, $recherche, $radical, $baseURL;
89
    $html_renvoyer = '';
90
 
91
    switch ($type_inclusion) {
92
        case 'rechercher' :
93
            $html_renvoyer .=   inclusion_html($GLOBALS['_EF_ANCIEN_']['type'].'_rechercher_titre').
94
                                '<h2>Rechercher une plante</h2>'."\n".
95
                                $alerte."\n".
96
                                '<form id="eflore_form_nomenclature" method="post" action="'.$baseURL.'">'."\n".
97
                                '<fieldset>'."\n".
98
                                '<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n".
99
                                '<ul>'."\n".
100
                                '<li>'."\n".
101
                                '<label for="radical">Nom :</label>'."\n".
5 jpm 102
                                '<input type="text" id="radical" name="radical" value="';
2 jpm 103
            $html_renvoyer .= (isset($radical) && !empty($radical))? $radical : '';
104
            $html_renvoyer .=   '" maxlength="100" size="30" />'."\n".
105
                                '</li>'."\n".
106
                                '<li>'."\n".
107
                                '<ul>'."\n".
108
                                '<li>'."\n".
109
                                '<input type="radio" id="ef_nom_scientifique" name="recherche" value="LATIN" ';
5 jpm 110
            $html_renvoyer .=    (empty($recherche))? 'checked="checked"': '';
2 jpm 111
            $html_renvoyer .=    (!empty($recherche) && $recherche == 'LATIN')? 'checked="checked"': '';
112
            $html_renvoyer .=    '/>'.
113
                                '<label for="ef_nom_scientifique">nom scientifique</label>'."\n".
114
                                '</li>'."\n".'<li>'."\n".
115
                                '<input type="radio" id="ef_nom_vernaculaire" name="recherche" value="VERNA" ';
116
            $html_renvoyer .=    (!empty($recherche) && $recherche == 'VERNA')? 'checked="checked"': '';
117
            $html_renvoyer .=    '/>'.
118
                                '<label for="ef_nom_vernaculaire">nom vernaculaire</label>'."\n".
119
                                '</li>'."\n".
120
                                '</ul>'."\n".
121
                                '</li>'."\n".
122
                                '</ul>'."\n".
5 jpm 123
                                '<input type="hidden" id="flore" name="flore" value="'.$GLOBALS['_EF_ANCIEN_']['type'].'" />'."\n".
124
                                '<input type="hidden" id="numclass" name="numclass" value="1" />'."\n".
2 jpm 125
                                '<input id="eflore_chercher" name="eflore_chercher" type="submit" value="chercher" />'."\n".
126
                                '</fieldset>'."\n".
127
                                '</form>';
128
            break;
129
        case 'ANT_rechercher_titre' :
130
            $html_renvoyer .=   '<h1>Consulter la base eFlore : Guadeloupe-Martinique</h1>'."\n";
131
            break;
132
        case 'REU_rechercher_titre' :
133
            $html_renvoyer .=   '<h1>Consulter la base eFlore : Réunion</h1>'."\n";
134
            break;
135
        case 'rechercher_aide' :
136
            $html_renvoyer .=   '<div id="eflore_exemple_nomenc">'."\n".
137
                                '<h2>'.EFLORE_LG_EXPLE_TITRE.'</h2>'."\n".
138
                                '<p>'.EFLORE_LG_EXPLE_NOMENC.'</p>'."\n".
139
                                '<p>'.EFLORE_LG_EXPLE_ASTUCE.'</p>'."\n".
140
                                '<ul id="eflore_liste_astuces">'."\n".
141
                                '  <li>'.sprintf(EFLORE_LG_EXPLE_ASTUCE_DEMO_01, '<tt>', '</tt>', '<tt>', '</tt>').'</li>'."\n".
142
                                '  <li>'.sprintf(EFLORE_LG_EXPLE_ASTUCE_DEMO_02, '<tt>', '</tt>').'</li>'."\n".
143
                                '</ul>'."\n".
144
                                '<p>'.EFLORE_LG_EXPLE_LANGUE.'</p>'."\n".
145
                                '<ul id="eflore_liste_langues">'."\n".
146
                                '  <li>'.EFLORE_LG_EXPLE_FR.'</li>'."\n".
147
                                '  <li>'.EFLORE_LG_EXPLE_ES.'</li>'."\n".
148
                                '  <li>'.EFLORE_LG_EXPLE_CA.'</li>'."\n".
149
                                '  <li>'.EFLORE_LG_EXPLE_DE.'</li>'."\n".
150
                                '  <li>'.EFLORE_LG_EXPLE_EN.'</li>'."\n".
151
                                '  <li>'.EFLORE_LG_EXPLE_NL.'</li>'."\n".
152
                                '  <li>'.EFLORE_LG_EXPLE_IT.'</li>'."\n".
153
                                '  <li>'.EFLORE_LG_EXPLE_ETC.'</li>'."\n".
154
                                '</ul>'."\n".
155
                                '</div>'."\n";
156
            break;
157
        case 'pied_page' :
158
            $html_renvoyer =    '<p id="eflore_pied_page">'.EFLORE_LG_PIED.'</p>';
159
            break;
160
        case 'debut_ligne_alerte' :
12 jp_milcent 161
            $html_renvoyer =    '<p class="information">';
2 jpm 162
            break;
163
        case 'fin_ligne_alerte' :
164
            $html_renvoyer =    '</p>';
165
            break;
166
    }//fin du switch
167
 
168
    return $html_renvoyer;
169
}//fin fonction inclusion_html
170
 
171
 
172
//-- Fin du code source  ------------------------------------------------------------
173
?>