Subversion Repositories eFlore/Archives.chorologie

Rev

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

Rev Author Line No. Line
5 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-chorologie.                                                              |
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
// +------------------------------------------------------------------------------------------------------+
14 jpm 24
// CVS : $Id: echoro_affichage_xhtml.fonct.php,v 1.2 2005-02-22 19:36:28 jpm Exp $
5 jpm 25
/**
26
* Fichier permettant d'inclure les données dans du XHTML.
27
*
28
* Fichier contenant des fonctions retournant du XHTML une fois les données passées en paramêtre incluse à l 'intérieur.
29
*
30
*@package eFlore
31
*@subpackage Chorologie
32
//Auteur original :
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
34
//Autres auteurs :
35
*@author        Aucun
36
*@copyright     Tela-Botanica 2000-2004
14 jpm 37
*@version       $Revision: 1.2 $ $Date: 2005-02-22 19:36:28 $
5 jpm 38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
/**
42
* Gestion des messages d'alerte.
43
*
44
*Cette fonction retourne un message d'alerte en XHTML.
45
*
46
* @param string le type de message d'alerte à retourner.
47
* @return string contient le message d'alerte en XHTML.
48
*/
49
function message_alerte($type_message){
50
    $message_renvoyer='';
51
 
52
    switch ($type_message){
53
        case '01' :
54
            $message_renvoyer =
55
            inclusion_html('debut_ligne_alerte').
56
            'Pas de taxon commençant par cette lettre dans ce département !'.
57
            inclusion_html('fin_ligne_alerte');
58
            break;
59
        case '02' :
60
            $message_renvoyer =
61
            inclusion_html('debut_ligne_alerte').
62
            'Aucune liste disponible pour l\'instant dans ce département !'.
63
            inclusion_html('fin_ligne_alerte');
64
            break;
65
    }//fin du switch
66
 
67
    $message_renvoyer = remplaceEntiteHTLM($message_renvoyer);
68
 
69
    return $message_renvoyer;
70
}
71
 
72
/**
73
* Gestion des inclusions XHTML dans le code PHP.
74
*
75
* Cette fonction retourne du XHTML à insérer dans le code PHP.
76
*
77
* @param string le type d'inclusion de XHTML à retourner.
78
* @param array le tableau des paramêtre à inclure dans le XHTML à retourner.
79
* @return string contient du XHTML à insérer dans le code PHP.
80
*/
81
 
82
function inclusion_html($type_inclusion, $variable = array())
83
{
84
    $html_renvoyer='';
85
 
86
    switch ($type_inclusion){
87
        //----------------------------- LES TITRES -----------------------------
14 jpm 88
        case 'titre_liste' :
5 jpm 89
            $html_renvoyer = '<h1>Département : '.$variable[0].'  ( '.$variable[1].' taxons )</h1>'."\n";
90
            break;
14 jpm 91
        case 'titre_carte' :
5 jpm 92
            $html_renvoyer = '<h1>'.$variable[0].' départements possédant une liste de plantes en cours d\'élaboration</h1>'."\n";
93
            break;
14 jpm 94
        case 'titre_corres' :
5 jpm 95
            $html_renvoyer = '<h1>Les correspondants départementaux</h1>'."\n";
96
            break;
14 jpm 97
        case 'titre_sources' :
5 jpm 98
            $html_renvoyer = '<h1>Les sources bibliographiques</h1>'."\n";
99
            break;
14 jpm 100
            case 'titre_avertir' :
5 jpm 101
            $html_renvoyer = '<h1>Avertissement concernant le projet chorologie départementale</h1>'."\n";
102
            break;
103
        //----------------------------- LES OUVERTURES DE TABLEAUX -----------------------------
14 jpm 104
        case 'tab_ouvre' :
5 jpm 105
            $html_renvoyer = '<table>'."\n";
106
            break;
14 jpm 107
        case 'tab_ouvre_liste_taxon' :
5 jpm 108
            if ($variable[0] == 'tous') {
109
                $html_renvoyer ='<h2>Affichage de tous les taxons du département</h2>';
110
            } else {
111
                $html_renvoyer ='<h2>Affichage des taxons commençant par la lettre : '.$variable[0].'</h2>';
112
            }
113
            $html_renvoyer .='<table>
114
                    <colgroup>
115
                        <col width="450px" class="texte_tb2">
116
                        <col width="150px" class="texte_tb2 texte_c">
117
                    </colgroup>
118
                    <thead>
119
                        <tr class="insTitle1 texte_c">
120
                            <th align="center" valign="middle">
121
                                Nom du taxon
122
                            </th>
123
                            <th align="center" valign="middle">
124
                                Indice
125
                            </th>
126
                        <tr class="texte_tb2 texte_c">
127
                            <th align="center" valign="middle">
128
                                <img name="info1" '.
129
                                    'src="Local/icons/idea.gif" '.
130
                                    'width="16" '.
131
                                    'height="16" '.
132
                                    'title=" En cliquant sur le nom d\'un taxon, vous accédez à sa fiche nomenclaturale.'.
133
                                            'Nombre vert : numéro nomenclatural. Nombre unique attribué à chaque nom. '.
134
                                            'Nombre rouge : numéro taxonomique. Tous les noms appartenant à un même taxon possédent le même numéro taxonomique." '.
135
                                    'alt="  En cliquant sur le nom d\'un taxon, vous accédez à sa fiche nomenclaturale. '.
136
                                            'Nombre vert : numéro nomenclatural. Nombre unique attribué à chaque nom. '.
137
                                            'Nombre rouge : numéro taxonomique. Tous les noms appartenant à un même taxon possédent le même numéro taxonomique." '.
138
                                    'align="center" '.
139
                                    'onMouseOver="AffBulle(\'En cliquant sur le nom d\\\'un taxon, vous accédez à sa fiche nomenclaturale. '.
140
                                                            '<br />Nombre vert : numéro nomenclatural. Nombre unique attribué à chaque nom. <br />'.
141
                                                            'Nombre rouge : numéro taxonomique. Tous les noms appartenant à un même taxon possédent le même numéro taxonomique.\')" '.
142
                                    'onMouseOut="HideBulle()" />
143
                            </th>
144
                            <th align="center" valign="middle">
145
                                <img name="info2" '.
146
                                'src="Local/icons/idea.gif" '.
147
                                'width="16" '.
148
                                'height="16" '.
149
                                'title="Indice de rareté : information sur la présence de l\'espèce dans le département." '.
150
                                'alt="Indice de rareté : information sur la présence de l\'espèce dans le département." '.
151
                                'align="center" '.
152
                                'onMouseOver="AffBulle(\'Indice de rareté : information sur la présence de l\\\'espèce dans le département.\')" '.
153
                                'onMouseOut="HideBulle()" />
154
                            </th>
155
                        </tr>
156
                    </thead>
157
                    <tbody>';
158
            break;
159
        //----------------------------- LES FERMETURES DE TABLEAUX -----------------------------
14 jpm 160
        case 'tab_evol_ferme' :
5 jpm 161
            $html_renvoyer ='</tbody>'."\n".'</table>'."\n";
162
            break;
14 jpm 163
        case 'tab_ferme' :
5 jpm 164
            $html_renvoyer = '</table>'."\n";
165
            break;
166
        //----------------------------- LES OUVERTURES DE LIGNES DE TABLEAUX -----------------------------
14 jpm 167
        case 'debut_ligne_alerte' :
168
            $html_renvoyer ='<p class="pap_erreur">'."\n";
5 jpm 169
            break;
170
        //----------------------------- LES FIN DE LIGNES DE TABLEAUX -----------------------------
14 jpm 171
        case 'fin_ligne_alerte' :
172
            $html_renvoyer ='</p>'."\n";
5 jpm 173
            break;
174
        //----------------------------- LES TEXTES DANS TABLEAUX -----------------------------
14 jpm 175
        case 'avertissement_carte' :
176
            $html_renvoyer =
177
                '<p>'."\n".
178
                'Cliquez sur une zone colorée de la carte pour afficher la liste des taxons.<br />'."\n".
179
                'La couleur est proportionnelle au nombre de taxons.'."\n".
180
                '</p>'."\n".
181
                '<h2>Avertissement : </h2>'."\n".
182
                '<p>'."\n".
183
                'Les informations fournies par cette application ne peuvent pas être considérées comme des références.<br />'."\n".
184
                'Ce sont des documents en cours d\'élaboration.<br />'."\n".
185
                '</p>'."\n";
5 jpm 186
            break;
14 jpm 187
 
188
        case 'info_dep' :
189
            $html_renvoyer = '<h1>Informations sur le département : </h1>'."\n".'<h2>Correspondant : </h2>'."\n";
190
            for ($i = 0; $i < count($variable[1]); $i++){
191
                if ($i >= 1) {
192
                    $html_renvoyer .= '
5 jpm 193
                    </tr>
194
                    <tr>
195
                        <td width="25%">&nbsp;</td>';
196
                }
197
                if(ereg("[@]", $variable[1][$i]['COURRIEL'])){
198
                    $html_renvoyer .= '
199
                        <td width="75%">
200
                            <a class="eflore_lien" href="mailto:'.$variable[1][$i]['COURRIEL'].'">'.$variable[1][$i]['PRENOM'].' '.$variable[1][$i]['NOM'].'</a>'.'
201
                        </td>';
202
                }
203
                else{
204
                    $html_renvoyer .= '
205
                        <td width="75%">'.$variable[1][$i]['PRENOM'].' '.$variable[1][$i]['NOM'].'</td>';
206
                }
207
            }
208
            $html_renvoyer .='
209
                    <tr class="texte_tb2">
210
                        <td width="17%" class="texte_tb2 texte_g" style="vertical-align: text-top;">Source : </td>';
211
            for($i=0;$i<count($variable[0]);$i++){
212
                if ($i>=1){
213
                $html_renvoyer .= '
214
                    </tr>
215
                    <tr>
216
                        <td width="17%">&nbsp;</td>';
217
                }
218
                $html_renvoyer .= '
219
                        <td width="83%">'.$variable[0][$i].'</td>';
220
            }
221
            $html_renvoyer .= '
222
                    </tr>';
223
            $html_renvoyer .= inclusion_html('tab_ferme');
224
            break;
14 jpm 225
 
226
        case 'intro_corres' :
227
            $html_renvoyer = '<h1>Dans quel but joindre les correspondant ?</h1>'.
228
                '<p>'."\n".
229
                'Il est utile d\'informer les correspondants départementaux lorsque vous constatez des erreurs dans les listes.<br />'."\n".
230
                'Ce ne sont que des listes de travail qui sont donc incomplètes ou qui peuvent indiquer des taxons disparus.<br />'."\n".
231
                'C\'est pour améliorer la qualité de ces listes et en faire profiter tous les membres du réseau que nous comptons sur votre participation.<br /><br />.'."\n".
232
                'La coordination du projet et l\'intégration des données sont assurées par <a href="mailto:philippe.julve@wanadoo.fr" class="eflore_lien">Philippe JULVE</a>'."\n".
233
                '</p>'."\n";
5 jpm 234
            break;
235
        //----------------------------- LES PIEDS DE PAGES -----------------------------
14 jpm 236
        case 'pied_page' :
5 jpm 237
            $html_renvoyer = '<p class="eflore_pied_page">'."\n";
238
            $html_renvoyer .= 'Si vous constatez des problèmes ou des insuffisances en utilisant cette application, veuillez contacter :'."\n";
239
            $html_renvoyer .= '<a href="mailto:jpm@tela-botanica.org">Jean-Pascal MILCENT</a>'."\n";
240
            $html_renvoyer .= '</p>'."\n";
241
            break;
242
 
243
    }//fin du switch
244
 
245
    $html_renvoyer = remplaceEntiteHTLM($html_renvoyer);
246
 
247
    return $html_renvoyer;
248
}//fin fonction inclusion_html
249
 
250
/* +--Fin du code ----------------------------------------------------------------------------------------+
251
*
252
* $Log: not supported by cvs2svn $
14 jpm 253
* Revision 1.1  2005/02/22 12:03:14  jpm
254
* Ajout des fichiers de la bibliothèque de l'application.
5 jpm 255
*
14 jpm 256
*
5 jpm 257
* +-- Fin du code ----------------------------------------------------------------------------------------+
258
*/
259
?>