Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 170 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 170 Rev 173
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.0.3                                                                                    |
4
// | PHP version 5.0.3                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eRibo.                                                                          |
8
// | This file is part of eRibo.                                                                          |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
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                                 |
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                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: recherche_nom_latin_xhtml.php,v 1.6 2005-06-09 18:09:52 jpm Exp $
24
// CVS : $Id: recherche_nom_latin_xhtml.php,v 1.7 2005-06-30 15:25:07 jpm Exp $
25
/**
25
/**
26
* Vue affichant la liste des noms latins correspondant à un radical recherché.
26
* Vue affichant la liste des noms latins correspondant à un radical recherché.
27
*
27
*
28
* Permet de retourner le html correspondant à la liste des noms latins correspondant à un radical recherché.
28
* Permet de retourner le html correspondant à la liste des noms latins correspondant à un radical recherché.
29
*
29
*
30
*@package eFlore
30
*@package eFlore
31
*@subpackage Vues
31
*@subpackage Vues
32
//Auteur original :
32
//Auteur original :
33
*@author        Frédéric LEGENS <flegens@free.fr>
33
*@author        Frédéric LEGENS <flegens@free.fr>
34
//Autres auteurs :
34
//Autres auteurs :
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@copyright     Tela-Botanica 2000-2004
36
*@copyright     Tela-Botanica 2000-2004
37
*@version       $Revision: 1.6 $ $Date: 2005-06-09 18:09:52 $
37
*@version       $Revision: 1.7 $ $Date: 2005-06-30 15:25:07 $
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
*/
39
*/
40
 
40
 
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
43
// +------------------------------------------------------------------------------------------------------+
-
 
44
/* Inclusion du fichier permettant de gérer l'encodage des noms vernaculaires*/
44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
45
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
-
 
46
/* Variable stockant le nombre de noms latins actuellement affichés*/
-
 
47
$GLOBALS['_NOM_LATIN_']['num'] = 0;
-
 
48
/* Variable permettant de savoir si on a déjà afficher l'entête de la liste des noms latins*/
-
 
49
$GLOBALS['_NOM_LATIN_']['tete'] = true;
-
 
50
/* Variable permettant de savoir si on a déjà afficher le pied de la liste des noms latins*/
-
 
51
$GLOBALS['_NOM_LATIN_']['pied'] = true;
45
 
52
 
46
// +------------------------------------------------------------------------------------------------------+
53
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CLASSE de la VUE                                          |
54
// |                                            CLASSE de la VUE                                          |
48
// +------------------------------------------------------------------------------------------------------+
55
// +------------------------------------------------------------------------------------------------------+
49
class recherche_nom_latin_xhtml implements iVue {
56
class recherche_nom_latin_xhtml implements iVue {
50
    
57
    
51
    protected $leBlock;
58
    protected $leBlock;
52
    
59
    
53
    function __construct($unBlock)
60
    function __construct($unBlock)
54
    {
61
    {
55
        $this->leBlock = $unBlock;
62
        $this->leBlock = $unBlock;
56
    }
63
    }
57
    
64
    
58
    function serialiser()
65
    function serialiser()
59
    {
66
    {
60
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
67
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
61
        $retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
68
        $retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
62
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
69
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
63
        
70
        
64
        $retour .= '<head>'."\n";
71
        $retour .= '<head>'."\n";
65
        $retour .= '<!-- BEGIN entete -->'."\n";
72
        $retour .= '<!-- BEGIN entete -->'."\n";
66
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
73
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
67
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
74
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
68
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
75
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
69
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
76
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
70
        $retour .= '<title>Liste de noms latins</title>'."\n";
77
        $retour .= '<title>Liste de noms latins</title>'."\n";
71
        $retour .= '<!-- END entete -->'."\n";
78
        $retour .= '<!-- END entete -->'."\n";
72
        $retour .= '</head>'."\n";
79
        $retour .= '</head>'."\n";
73
        
80
        
74
        $retour .= '<body>'."\n";
81
        $retour .= '<body>'."\n";
75
        $retour .= '<!-- BEGIN corps -->'."\n";
82
        $retour .= '<!-- BEGIN corps -->'."\n";
76
        $retour .= '<h1>'.'Liste des noms trouvés'.'</h1>'."\n";
83
        $retour .= '<h1>'.'Liste des noms trouvés'.'</h1>'."\n";
77
        $retour .= '<h2>'.'Résumé de la recherche :'.'</h2>'."\n";
84
        $retour .= '<h2>'.'Résumé de la recherche :'.'</h2>'."\n";
78
        $retour .= '<dl>'."\n";
85
        $retour .= '<dl>'."\n";
79
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS','afficherRadicalRang');
86
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS','afficherRadicalRang');
80
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>PROJET_VERSION','afficherResumerRecherche');
87
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>PROJET_VERSION','afficherResumerRecherche');
81
        $retour .= '</dl>'."\n";
88
        $retour .= '</dl>'."\n";
82
        $retour .= '<ol>'."\n";
89
        $retour .= '<ol>'."\n";
-
 
90
        
83
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>NOM_RECHERCHE','afficherNom');
91
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>NOM_RECHERCHE','afficherNom');
84
        $retour .= '</ol>'."\n";
92
        $retour .= '</ol>'."\n";
85
        $retour .= '<!-- END corps -->'."\n";
93
        $retour .= '<!-- END corps -->'."\n";
86
        $retour .= '</body>'."\n";
94
        $retour .= '</body>'."\n";
87
        $retour .= '</html>'."\n";
95
        $retour .= '</html>'."\n";
88
        
96
        
89
        // Envoi au navigateur après encodage en entité des caractères posant problème
97
        // Envoi au navigateur après encodage en entité des caractères posant problème
90
        echo remplaceEntiteHTLM($retour);
98
        echo remplaceEntiteHTLM($retour);
91
    }
99
    }
92
}
100
}
93
 
101
 
94
// +------------------------------------------------------------------------------------------------------+
102
// +------------------------------------------------------------------------------------------------------+
95
// |                                            LISTE des FONCTIONS                                       |
103
// |                                            LISTE des FONCTIONS                                       |
96
// +------------------------------------------------------------------------------------------------------+
104
// +------------------------------------------------------------------------------------------------------+
97
function afficherRadicalRang($donnees)
105
function afficherRadicalRang($donnees)
98
{
106
{
99
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
107
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
100
    $retour = '<dt>'.'Radical : '.'</dt>'."\n";
108
    $retour = '<dt>'.'Radical : '.'</dt>'."\n";
101
    $retour .= '<dd>'.$donnees['radical'].'</dd>'."\n";
109
    $retour .= '<dd>'.$donnees['radical'].'</dd>'."\n";
102
    if ($donnees['rang'] != '' || $donnees['rang'] != 0) {
110
    if ($donnees['rang'] != '' || $donnees['rang'] != 0) {
103
        $retour .= '<dt>'.'Rang : '.'</dt>'."\n";
111
        $retour .= '<dt>'.'Rang : '.'</dt>'."\n";
104
        $retour .= '<dd>'.$donnees['rang'].'</dd>'."\n";
112
        $retour .= '<dd>'.$donnees['rang'].'</dd>'."\n";
105
    }
113
    }
106
 
114
 
107
    return $retour;
115
    return $retour;
108
}
116
}
109
 
117
 
110
function afficherResumerRecherche($donnees)
118
function afficherResumerRecherche($donnees)
111
{
119
{
112
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
120
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
113
    $retour = '';
121
    $retour = '';
114
    if ($donnees['epr_intitule_projet'] != '' || $donnees['epr_intitule_projet'] != 0) {
122
    if (!empty($donnees['epr_intitule_projet'])) {
115
        $retour .= '<dt>'.'Référentiel : '.'</dt>'."\n";
123
        $retour .= '<dt>'.'Référentiel : '.'</dt>'."\n";
116
        $retour .= '<dd>'.$donnees['epr_intitule_projet'].' - Version : '.$donnees['eprv_code_version'].'</dd>'."\n";
124
        $retour .= '<dd>'.$donnees['epr_intitule_projet'].' - Version : '.$donnees['eprv_code_version'].'</dd>'."\n";
117
    }
125
    }
118
    return $retour;
126
    return $retour;
119
}
127
}
-
 
128
function afficherListeEntete($donnees)
120
 
129
{
-
 
130
    $retour = '';
-
 
131
    if ($GLOBALS['_NOM_LATIN_']['tete'] == true) {
-
 
132
        $GLOBALS['_NOM_LATIN_']['tete'] = false;
-
 
133
        $retour .= '<ol>'."\n";
-
 
134
    }
-
 
135
    return $retour;
-
 
136
}
121
function afficherNom($donnees)
137
function afficherNom($donnees)
122
{
138
{
123
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
139
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
-
 
140
    ++$GLOBALS['_NOM_LATIN_']['num'];
124
    $retour = '<li>';
141
    $retour = '<li>';
125
    if (isset($donnees['esn_ce_statut'])) {
142
    if (isset($donnees['esn_ce_statut'])) {
126
        if ($donnees['esn_ce_statut'] == 3) {//Nom retenu
143
        if ($donnees['esn_ce_statut'] == 3) {//Nom retenu
127
            $retour .= '<strong><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></strong>';
144
            $retour .= '<strong><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></strong>';
128
        } else {
145
        } else {
129
            $retour .= '<a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a>';
146
            $retour .= '<a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a>';
130
        }
147
        }
131
    } else {
148
    } else {
132
        $retour .= '<a href="{UrlFicheNom}'.$donnees['en_id_nom'].'">'.$donnees['eni_intitule_nom'].'</a>';
149
        $retour .= '<a href="{UrlFicheNom}'.$donnees['en_id_nom'].'">'.$donnees['eni_intitule_nom'].'</a>';
133
    }
150
    }
134
    $retour .= '</li>'."\n";
151
    $retour .= '</li>'."\n";
135
    return $retour;
152
    return $retour;
136
}
153
}
-
 
154
function afficherListePied($donnees)
137
 
155
{
-
 
156
    $retour = '';
-
 
157
    if ($GLOBALS['_NOM_LATIN_']['pied'] == true) {
-
 
158
        $GLOBALS['_NOM_LATIN_']['pied'] = false;
-
 
159
        $retour .= '</ol>'."\n";
-
 
160
    }
-
 
161
    return $retour;
-
 
162
}
-
 
163
function afficherMessage($donnees = array())
-
 
164
{
-
 
165
    $retour = '';
-
 
166
    if ($GLOBALS['_NOM_LATIN_']['num'] == 0) {
-
 
167
        $retour .= '<p class="information">'.'Aucun nom latin ne correspond à ce radical!'.'</p>'."\n";
-
 
168
    }
-
 
169
    return $retour;
-
 
170
}
138
// +------------------------------------------------------------------------------------------------------+
171
// +------------------------------------------------------------------------------------------------------+
139
// |                                            PIED du PROGRAMME                                         |
172
// |                                            PIED du PROGRAMME                                         |
140
// +------------------------------------------------------------------------------------------------------+
173
// +------------------------------------------------------------------------------------------------------+
141
 
174
 
142
 
175
 
143
/* +--Fin du code ----------------------------------------------------------------------------------------+
176
/* +--Fin du code ----------------------------------------------------------------------------------------+
144
*
177
*
145
* $Log: not supported by cvs2svn $
178
* $Log: not supported by cvs2svn $
-
 
179
* Revision 1.6  2005/06/09 18:09:52  jpm
-
 
180
* Début gestion des référenciels dans la recherche nomenclaturale.
-
 
181
*
146
* Revision 1.5  2005/03/15 13:45:42  tam
182
* Revision 1.5  2005/03/15 13:45:42  tam
147
* modifs labels
183
* modifs labels
148
*
184
*
149
* Revision 1.4  2005/01/28 19:47:09  jpm
185
* Revision 1.4  2005/01/28 19:47:09  jpm
150
* Amélioration du rendu par ajout d'entité à la place des caractères posant pb et changement de l'encodage.
186
* Amélioration du rendu par ajout d'entité à la place des caractères posant pb et changement de l'encodage.
151
*
187
*
152
* Revision 1.3  2005/01/26 10:45:13  jpm
188
* Revision 1.3  2005/01/26 10:45:13  jpm
153
* Ajout de commentaires d'entête.
189
* Ajout de commentaires d'entête.
154
*
190
*
155
*
191
*
156
* +-- Fin du code ----------------------------------------------------------------------------------------+
192
* +-- Fin du code ----------------------------------------------------------------------------------------+
157
*/
193
*/
158
?>
194
?>