Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev Author Line No. Line
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
// +------------------------------------------------------------------------------------------------------+
170 jpm 24
// CVS : $Id: recherche_nom_latin_xhtml.php,v 1.6 2005-06-09 18:09:52 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
170 jpm 37
*@version       $Revision: 1.6 $ $Date: 2005-06-09 18:09:52 $
118 jpm 38
// +------------------------------------------------------------------------------------------------------+
39
*/
71 jpm 40
 
118 jpm 41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
125 jpm 44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
71 jpm 45
 
118 jpm 46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CLASSE de la VUE                                          |
48
// +------------------------------------------------------------------------------------------------------+
78 jpm 49
class recherche_nom_latin_xhtml implements iVue {
71 jpm 50
 
51
    protected $leBlock;
52
 
53
    function __construct($unBlock)
54
    {
55
        $this->leBlock = $unBlock;
56
    }
57
 
58
    function serialiser()
59
    {
125 jpm 60
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
71 jpm 61
        $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";
63
 
64
        $retour .= '<head>'."\n";
65
        $retour .= '<!-- BEGIN entete -->'."\n";
125 jpm 66
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
71 jpm 67
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
68
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
69
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
70
        $retour .= '<title>Liste de noms latins</title>'."\n";
71
        $retour .= '<!-- END entete -->'."\n";
72
        $retour .= '</head>'."\n";
73
 
74
        $retour .= '<body>'."\n";
75
        $retour .= '<!-- BEGIN corps -->'."\n";
163 tam 76
        $retour .= '<h1>'.'Liste des noms trouvés'.'</h1>'."\n";
170 jpm 77
        $retour .= '<h2>'.'Résumé de la recherche :'.'</h2>'."\n";
78
        $retour .= '<dl>'."\n";
79
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS','afficherRadicalRang');
80
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>PROJET_VERSION','afficherResumerRecherche');
81
        $retour .= '</dl>'."\n";
71 jpm 82
        $retour .= '<ol>'."\n";
118 jpm 83
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS>NOM_RECHERCHE','afficherNom');
71 jpm 84
        $retour .= '</ol>'."\n";
85
        $retour .= '<!-- END corps -->'."\n";
86
        $retour .= '</body>'."\n";
87
        $retour .= '</html>'."\n";
125 jpm 88
 
89
        // Envoi au navigateur après encodage en entité des caractères posant problème
90
        echo remplaceEntiteHTLM($retour);
71 jpm 91
    }
118 jpm 92
}
93
 
94
// +------------------------------------------------------------------------------------------------------+
95
// |                                            LISTE des FONCTIONS                                       |
96
// +------------------------------------------------------------------------------------------------------+
170 jpm 97
function afficherRadicalRang($donnees)
118 jpm 98
{
170 jpm 99
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
100
    $retour = '<dt>'.'Radical : '.'</dt>'."\n";
101
    $retour .= '<dd>'.$donnees['radical'].'</dd>'."\n";
118 jpm 102
    if ($donnees['rang'] != '' || $donnees['rang'] != 0) {
170 jpm 103
        $retour .= '<dt>'.'Rang : '.'</dt>'."\n";
104
        $retour .= '<dd>'.$donnees['rang'].'</dd>'."\n";
71 jpm 105
    }
170 jpm 106
 
118 jpm 107
    return $retour;
71 jpm 108
}
118 jpm 109
 
170 jpm 110
function afficherResumerRecherche($donnees)
111
{
112
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
113
    $retour = '';
114
    if ($donnees['epr_intitule_projet'] != '' || $donnees['epr_intitule_projet'] != 0) {
115
        $retour .= '<dt>'.'Référentiel : '.'</dt>'."\n";
116
        $retour .= '<dd>'.$donnees['epr_intitule_projet'].' - Version : '.$donnees['eprv_code_version'].'</dd>'."\n";
117
    }
118
    return $retour;
119
}
120
 
118 jpm 121
function afficherNom($donnees)
122
{
170 jpm 123
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
124
    $retour = '<li>';
125
    if (isset($donnees['esn_ce_statut'])) {
126
        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>';
128
        } else {
129
            $retour .= '<a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a>';
130
        }
131
    } else {
132
        $retour .= '<a href="{UrlFicheNom}'.$donnees['en_id_nom'].'">'.$donnees['eni_intitule_nom'].'</a>';
133
    }
134
    $retour .= '</li>'."\n";
118 jpm 135
    return $retour;
136
}
137
 
138
// +------------------------------------------------------------------------------------------------------+
139
// |                                            PIED du PROGRAMME                                         |
140
// +------------------------------------------------------------------------------------------------------+
141
 
142
 
143
/* +--Fin du code ----------------------------------------------------------------------------------------+
144
*
145
* $Log: not supported by cvs2svn $
170 jpm 146
* Revision 1.5  2005/03/15 13:45:42  tam
147
* modifs labels
148
*
163 tam 149
* 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.
151
*
125 jpm 152
* Revision 1.3  2005/01/26 10:45:13  jpm
153
* Ajout de commentaires d'entête.
118 jpm 154
*
125 jpm 155
*
118 jpm 156
* +-- Fin du code ----------------------------------------------------------------------------------------+
157
*/
71 jpm 158
?>