Subversion Repositories eFlore/Archives.eflore-consultation-v1

Rev

Rev 5 | Go to most recent revision | Details | 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
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: eflore_affichage_xhtml.fonct.php,v 1.1 2005-05-24 15:57:48 jpm Exp $
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
35
*@version       $Revision: 1.1 $ $Date: 2005-05-24 15:57:48 $
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' :
56
            $message_renvoyer = inclusion_html("debut_ligne_alerte")."Veuillez saisir un radical avant d'effectuer la recherche !".inclusion_html("fin_ligne_alerte");
57
            break;
58
        case '02' :
59
            $message_renvoyer = inclusion_html("debut_ligne_alerte")."Veuillez saisir un radical contenant au moins 3 caract&egrave;res alphab&eacute;tiques !".inclusion_html("fin_ligne_alerte");
60
            break;
61
        case '03' :
62
            $message_renvoyer = inclusion_html("debut_ligne_alerte")."Le symbole % ne peut pas être utilis&eacute; sans au moins trois caract&egrave;res alphab&eacute;tiques !".inclusion_html("fin_ligne_alerte");
63
            break;
64
        case '04' :
65
            $message_renvoyer = inclusion_html("debut_ligne_alerte")."Les symboles suivant ne doivent pas &ecirc;tre utilis&eacute;s : & < > \" ".inclusion_html("fin_ligne_alerte");
66
            break;
67
    }//fin du switch
68
 
69
    return $message_renvoyer;
70
}
71
 
72
/**
73
* Gestion des inclusions html dans le code php.
74
*
75
*Cette fonction retourne du html à insérer dans le php.
76
*
77
* @return string
78
*/
79
function inclusion_html($type_inclusion)
80
{
81
    global $alerte, $flore, $recherche, $radical, $baseURL;
82
    $html_renvoyer = '';
83
 
84
    switch ($type_inclusion) {
85
        case 'rechercher' :
86
            $html_renvoyer .=   inclusion_html($GLOBALS['_EF_ANCIEN_']['type'].'_rechercher_titre').
87
                                '<h2>Rechercher une plante</h2>'."\n".
88
                                $alerte."\n".
89
                                '<form id="eflore_form_nomenclature" method="post" action="'.$baseURL.'">'."\n".
90
                                '<fieldset>'."\n".
91
                                '<legend>'.EFLORE_LG_RECH_NOM_FORM_TITRE.'</legend>'."\n".
92
                                '<ul>'."\n".
93
                                '<li>'."\n".
94
                                '<label for="radical">Nom :</label>'."\n".
95
                                '<input type="text" name="radical" value="';
96
            $html_renvoyer .= (isset($radical) && !empty($radical))? $radical : '';
97
            $html_renvoyer .=   '" maxlength="100" size="30" />'."\n".
98
                                '</li>'."\n".
99
                                '<li>'."\n".
100
                                '<ul>'."\n".
101
                                '<li>'."\n".
102
                                '<input type="radio" id="ef_nom_scientifique" name="recherche" value="LATIN" ';
103
            $html_renvoyer .=    (!empty($recherche) && $recherche == 'LATIN')? 'checked="checked"': '';
104
            $html_renvoyer .=    '/>'.
105
                                '<label for="ef_nom_scientifique">nom scientifique</label>'."\n".
106
                                '</li>'."\n".'<li>'."\n".
107
                                '<input type="radio" id="ef_nom_vernaculaire" name="recherche" value="VERNA" ';
108
            $html_renvoyer .=    (!empty($recherche) && $recherche == 'VERNA')? 'checked="checked"': '';
109
            $html_renvoyer .=    '/>'.
110
                                '<label for="ef_nom_vernaculaire">nom vernaculaire</label>'."\n".
111
                                '</li>'."\n".
112
                                '</ul>'."\n".
113
                                '</li>'."\n".
114
                                '</ul>'."\n".
115
                                '<input type="hidden" name="flore" value="'.$GLOBALS['_EF_ANCIEN_']['type'].'" />'."\n".
116
                                '<input type="hidden" name="numclass" value="1" />'."\n".
117
                                '<input id="eflore_chercher" name="eflore_chercher" type="submit" value="chercher" />'."\n".
118
                                '</fieldset>'."\n".
119
                                '</form>';
120
            break;
121
        case 'ANT_rechercher_titre' :
122
            $html_renvoyer .=   '<h1>Consulter la base eFlore : Guadeloupe-Martinique</h1>'."\n";
123
            break;
124
        case 'REU_rechercher_titre' :
125
            $html_renvoyer .=   '<h1>Consulter la base eFlore : Réunion</h1>'."\n";
126
            break;
127
        case 'rechercher_aide' :
128
            $html_renvoyer .=   '<div id="eflore_exemple_nomenc">'."\n".
129
                                '<h2>'.EFLORE_LG_EXPLE_TITRE.'</h2>'."\n".
130
                                '<p>'.EFLORE_LG_EXPLE_NOMENC.'</p>'."\n".
131
                                '<p>'.EFLORE_LG_EXPLE_ASTUCE.'</p>'."\n".
132
                                '<ul id="eflore_liste_astuces">'."\n".
133
                                '  <li>'.sprintf(EFLORE_LG_EXPLE_ASTUCE_DEMO_01, '<tt>', '</tt>', '<tt>', '</tt>').'</li>'."\n".
134
                                '  <li>'.sprintf(EFLORE_LG_EXPLE_ASTUCE_DEMO_02, '<tt>', '</tt>').'</li>'."\n".
135
                                '</ul>'."\n".
136
                                '<p>'.EFLORE_LG_EXPLE_LANGUE.'</p>'."\n".
137
                                '<ul id="eflore_liste_langues">'."\n".
138
                                '  <li>'.EFLORE_LG_EXPLE_FR.'</li>'."\n".
139
                                '  <li>'.EFLORE_LG_EXPLE_ES.'</li>'."\n".
140
                                '  <li>'.EFLORE_LG_EXPLE_CA.'</li>'."\n".
141
                                '  <li>'.EFLORE_LG_EXPLE_DE.'</li>'."\n".
142
                                '  <li>'.EFLORE_LG_EXPLE_EN.'</li>'."\n".
143
                                '  <li>'.EFLORE_LG_EXPLE_NL.'</li>'."\n".
144
                                '  <li>'.EFLORE_LG_EXPLE_IT.'</li>'."\n".
145
                                '  <li>'.EFLORE_LG_EXPLE_ETC.'</li>'."\n".
146
                                '</ul>'."\n".
147
                                '</div>'."\n";
148
            break;
149
        case 'pied_page' :
150
            $html_renvoyer =    '<p id="eflore_pied_page">'.EFLORE_LG_PIED.'</p>';
151
            break;
152
        case 'debut_ligne_alerte' :
153
            $html_renvoyer =    '<p ="attention">Attention';
154
            break;
155
        case 'fin_ligne_alerte' :
156
            $html_renvoyer =    '</p>';
157
            break;
158
    }//fin du switch
159
 
160
    return $html_renvoyer;
161
}//fin fonction inclusion_html
162
 
163
 
164
//-- Fin du code source  ------------------------------------------------------------
165
?>