71 |
jpm |
1 |
<?php
|
118 |
jpm |
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 |
// +------------------------------------------------------------------------------------------------------+
|
173 |
jpm |
24 |
// CVS : $Id: recherche_nom_latin_xhtml.php,v 1.7 2005-06-30 15:25:07 jpm Exp $
|
118 |
jpm |
25 |
/**
|
|
|
26 |
* Vue affichant la liste des noms latins correspondant à un radical recherché.
|
|
|
27 |
*
|
|
|
28 |
* Permet de retourner le html correspondant à la liste des noms latins correspondant à un radical recherché.
|
|
|
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
|
173 |
jpm |
37 |
*@version $Revision: 1.7 $ $Date: 2005-06-30 15:25:07 $
|
118 |
jpm |
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
*/
|
71 |
jpm |
40 |
|
118 |
jpm |
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
// | ENTETE du PROGRAMME |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
173 |
jpm |
44 |
/* Inclusion du fichier permettant de gérer l'encodage des noms vernaculaires*/
|
125 |
jpm |
45 |
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
|
173 |
jpm |
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;
|
71 |
jpm |
52 |
|
118 |
jpm |
53 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
54 |
// | CLASSE de la VUE |
|
|
|
55 |
// +------------------------------------------------------------------------------------------------------+
|
78 |
jpm |
56 |
class recherche_nom_latin_xhtml implements iVue {
|
71 |
jpm |
57 |
|
|
|
58 |
protected $leBlock;
|
|
|
59 |
|
|
|
60 |
function __construct($unBlock)
|
|
|
61 |
{
|
|
|
62 |
$this->leBlock = $unBlock;
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
function serialiser()
|
|
|
66 |
{
|
125 |
jpm |
67 |
$retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
|
71 |
jpm |
68 |
$retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
|
|
|
69 |
$retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
|
|
|
70 |
|
|
|
71 |
$retour .= '<head>'."\n";
|
|
|
72 |
$retour .= '<!-- BEGIN entete -->'."\n";
|
125 |
jpm |
73 |
$retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
|
71 |
jpm |
74 |
$retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
|
|
|
75 |
$retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
|
|
|
76 |
$retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
|
|
|
77 |
$retour .= '<title>Liste de noms latins</title>'."\n";
|
|
|
78 |
$retour .= '<!-- END entete -->'."\n";
|
|
|
79 |
$retour .= '</head>'."\n";
|
|
|
80 |
|
|
|
81 |
$retour .= '<body>'."\n";
|
|
|
82 |
$retour .= '<!-- BEGIN corps -->'."\n";
|
163 |
tam |
83 |
$retour .= '<h1>'.'Liste des noms trouvés'.'</h1>'."\n";
|
170 |
jpm |
84 |
$retour .= '<h2>'.'Résumé de la recherche :'.'</h2>'."\n";
|
|
|
85 |
$retour .= '<dl>'."\n";
|
|
|
86 |
$retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS','afficherRadicalRang');
|
|
|
87 |
$retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>PROJET_VERSION','afficherResumerRecherche');
|
|
|
88 |
$retour .= '</dl>'."\n";
|
71 |
jpm |
89 |
$retour .= '<ol>'."\n";
|
173 |
jpm |
90 |
|
118 |
jpm |
91 |
$retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>NOM_RECHERCHE','afficherNom');
|
71 |
jpm |
92 |
$retour .= '</ol>'."\n";
|
|
|
93 |
$retour .= '<!-- END corps -->'."\n";
|
|
|
94 |
$retour .= '</body>'."\n";
|
|
|
95 |
$retour .= '</html>'."\n";
|
125 |
jpm |
96 |
|
|
|
97 |
// Envoi au navigateur après encodage en entité des caractères posant problème
|
|
|
98 |
echo remplaceEntiteHTLM($retour);
|
71 |
jpm |
99 |
}
|
118 |
jpm |
100 |
}
|
|
|
101 |
|
|
|
102 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
103 |
// | LISTE des FONCTIONS |
|
|
|
104 |
// +------------------------------------------------------------------------------------------------------+
|
170 |
jpm |
105 |
function afficherRadicalRang($donnees)
|
118 |
jpm |
106 |
{
|
170 |
jpm |
107 |
//$retour = '<pre>'.print_r($donnees, true).'</pre>';
|
|
|
108 |
$retour = '<dt>'.'Radical : '.'</dt>'."\n";
|
|
|
109 |
$retour .= '<dd>'.$donnees['radical'].'</dd>'."\n";
|
118 |
jpm |
110 |
if ($donnees['rang'] != '' || $donnees['rang'] != 0) {
|
170 |
jpm |
111 |
$retour .= '<dt>'.'Rang : '.'</dt>'."\n";
|
|
|
112 |
$retour .= '<dd>'.$donnees['rang'].'</dd>'."\n";
|
71 |
jpm |
113 |
}
|
170 |
jpm |
114 |
|
118 |
jpm |
115 |
return $retour;
|
71 |
jpm |
116 |
}
|
118 |
jpm |
117 |
|
170 |
jpm |
118 |
function afficherResumerRecherche($donnees)
|
|
|
119 |
{
|
|
|
120 |
//$retour .= '<pre>'.print_r($donnees, true).'</pre>';
|
|
|
121 |
$retour = '';
|
173 |
jpm |
122 |
if (!empty($donnees['epr_intitule_projet'])) {
|
170 |
jpm |
123 |
$retour .= '<dt>'.'Référentiel : '.'</dt>'."\n";
|
|
|
124 |
$retour .= '<dd>'.$donnees['epr_intitule_projet'].' - Version : '.$donnees['eprv_code_version'].'</dd>'."\n";
|
|
|
125 |
}
|
|
|
126 |
return $retour;
|
|
|
127 |
}
|
173 |
jpm |
128 |
function afficherListeEntete($donnees)
|
|
|
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 |
}
|
118 |
jpm |
137 |
function afficherNom($donnees)
|
|
|
138 |
{
|
170 |
jpm |
139 |
//$retour = '<pre>'.print_r($donnees, true).'</pre>';
|
173 |
jpm |
140 |
++$GLOBALS['_NOM_LATIN_']['num'];
|
170 |
jpm |
141 |
$retour = '<li>';
|
|
|
142 |
if (isset($donnees['esn_ce_statut'])) {
|
|
|
143 |
if ($donnees['esn_ce_statut'] == 3) {//Nom retenu
|
|
|
144 |
$retour .= '<strong><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></strong>';
|
|
|
145 |
} else {
|
|
|
146 |
$retour .= '<a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a>';
|
|
|
147 |
}
|
|
|
148 |
} else {
|
|
|
149 |
$retour .= '<a href="{UrlFicheNom}'.$donnees['en_id_nom'].'">'.$donnees['eni_intitule_nom'].'</a>';
|
|
|
150 |
}
|
|
|
151 |
$retour .= '</li>'."\n";
|
118 |
jpm |
152 |
return $retour;
|
|
|
153 |
}
|
173 |
jpm |
154 |
function afficherListePied($donnees)
|
|
|
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 |
}
|
118 |
jpm |
171 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
172 |
// | PIED du PROGRAMME |
|
|
|
173 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
177 |
*
|
|
|
178 |
* $Log: not supported by cvs2svn $
|
173 |
jpm |
179 |
* Revision 1.6 2005/06/09 18:09:52 jpm
|
|
|
180 |
* Début gestion des référenciels dans la recherche nomenclaturale.
|
|
|
181 |
*
|
170 |
jpm |
182 |
* Revision 1.5 2005/03/15 13:45:42 tam
|
|
|
183 |
* modifs labels
|
|
|
184 |
*
|
163 |
tam |
185 |
* Revision 1.4 2005/01/28 19:47:09 jpm
|
|
|
186 |
* Amélioration du rendu par ajout d'entité à la place des caractères posant pb et changement de l'encodage.
|
|
|
187 |
*
|
125 |
jpm |
188 |
* Revision 1.3 2005/01/26 10:45:13 jpm
|
|
|
189 |
* Ajout de commentaires d'entête.
|
118 |
jpm |
190 |
*
|
125 |
jpm |
191 |
*
|
118 |
jpm |
192 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
193 |
*/
|
71 |
jpm |
194 |
?>
|