Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev 137 Rev 144
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_classif_xhtml.php,v 1.1 2005-02-09 13:07:16 jpm Exp $
24
// CVS : $Id: recherche_classif_xhtml.php,v 1.2 2005-02-14 18:11:43 jpm Exp $
25
/**
25
/**
26
* Vue affichant la liste des taxons d'un projet.
26
* Vue affichant la liste des taxons d'un projet.
27
*
27
*
28
* Permet de retourner le xhtml correspondant à une liste hiérarchisées des taxons d'un projet.
28
* Permet de retourner le xhtml correspondant à une liste hiérarchisées des taxons d'un projet.
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.1 $ $Date: 2005-02-09 13:07:16 $
37
*@version       $Revision: 1.2 $ $Date: 2005-02-14 18:11:43 $
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
*/
39
*/
40
 
40
 
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
43
// +------------------------------------------------------------------------------------------------------+
44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
45
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CLASSE de la VUE                                          |
47
// |                                            CLASSE de la VUE                                          |
48
// +------------------------------------------------------------------------------------------------------+
48
// +------------------------------------------------------------------------------------------------------+
49
class recherche_classif_xhtml implements iVue {
49
class recherche_classif_xhtml implements iVue {
50
    
50
    
51
    protected $leBlock;
51
    protected $leBlock;
52
    
52
    
53
    function __construct($unBlock)
53
    function __construct($unBlock)
54
    {
54
    {
55
        $this->leBlock = $unBlock;
55
        $this->leBlock = $unBlock;
56
    }
56
    }
57
    
57
    
58
    function serialiser()
58
    function serialiser()
59
    {
59
    {
60
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
60
        $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";
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";
62
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
63
        
63
        
64
        $retour .= '<head>'."\n";
64
        $retour .= '<head>'."\n";
65
        $retour .= '<!-- BEGIN entete -->'."\n";
65
        $retour .= '<!-- BEGIN entete -->'."\n";
66
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
66
        $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";
67
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
68
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
68
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
69
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
69
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
70
        $retour .= '<title>Liste de taxons</title>'."\n";
70
        $retour .= '<title>Liste de taxons</title>'."\n";
71
        $retour .= '<!-- END entete -->'."\n";
71
        $retour .= '<!-- END entete -->'."\n";
72
        $retour .= '</head>'."\n";
72
        $retour .= '</head>'."\n";
73
        
73
        
74
        $retour .= '<body>'."\n";
74
        $retour .= '<body>'."\n";
75
        $retour .= '<!-- BEGIN corps -->'."\n";
75
        $retour .= '<!-- BEGIN corps -->'."\n";
76
        $retour .= '<h1>'.'Liste des taxons'.'</h1>'."\n";
76
        $retour .= '<h1>'.'Liste des taxons'.'</h1>'."\n";
-
 
77
        $retour .= '<!-- BEGIN liste -->'."\n";
77
        $retour .= $this->leBlock->afficherPatternRecursivement('afficherTaxon', 'TAXON_RECHERCHE_CLASSIFICATION');
78
        $retour .= $this->leBlock->afficherPatternRecursivement('afficherTaxon', 'TAXON_RECHERCHE_CLASSIFICATION');
-
 
79
        $retour .= '<!-- END liste -->'."\n";
78
        $retour .= '<!-- END corps -->'."\n";
80
        $retour .= '<!-- END corps -->'."\n";
79
        $retour .= '</body>'."\n";
81
        $retour .= '</body>'."\n";
80
        $retour .= '</html>'."\n";
82
        $retour .= '</html>'."\n";
81
        
83
        
82
        // Envoi au navigateur après encodage en entité des caractères posant problème
84
        // Envoi au navigateur après encodage en entité des caractères posant problème
83
        echo remplaceEntiteHTLM($retour);
85
        echo remplaceEntiteHTLM($retour);
84
    }
86
    }
85
}
87
}
86
 
88
 
87
// +------------------------------------------------------------------------------------------------------+
89
// +------------------------------------------------------------------------------------------------------+
88
// |                                            LISTE des FONCTIONS                                       |
90
// |                                            LISTE des FONCTIONS                                       |
89
// +------------------------------------------------------------------------------------------------------+
91
// +------------------------------------------------------------------------------------------------------+
90
 
92
 
91
function afficherTaxon($donnees, $parametre)
93
function afficherTaxon($donnees, $parametre)
92
{
94
{
93
    //echo '<pre>'.print_r($donnees, true).'</pre>';
95
    //echo '<pre>'.print_r($donnees, true).'</pre>';
94
    if (isset($donnees['eni_intitule_nom'])) {
96
    if (isset($donnees['eni_intitule_nom'])) {
95
        if (!empty($donnees['eni_intitule_nom'])) {
97
        if (!empty($donnees['eni_intitule_nom'])) {
96
            $retour .= '<li><a href="{UrlFicheNom}'.$donnees['en_id_nom'].'">';
98
            $retour .= '<a href="func_remplacerUrlClassif('.$donnees['etr_id_taxon_1'].')">';
-
 
99
            $retour .= '<img src="#" alt="+"/>';
-
 
100
            $retour .= '</a><a id="eflore_taxon_'.$donnees['etr_id_taxon_1'].'" href="{UrlFicheNom}'.$donnees['en_id_nom'].'">';
97
            $retour .= $donnees['eni_intitule_nom'];
101
            $retour .= $donnees['eni_intitule_nom'];
98
            $retour .= '</a>'."\n";
102
            $retour .= '</a>'."\n";
99
            
103
            
100
            $retour_tax = '';
104
            $retour_tax = '';
101
            $nbre_taxon = 0;
105
            $nbre_taxon = 0;
102
            foreach ($donnees as $cle => $valeur) {
106
            foreach ($donnees as $cle => $valeur) {
103
                if (strstr($cle, $parametre)) {
107
                if (strstr($cle, $parametre)) {
104
                    $retour_tax .= afficherTaxon($valeur, $parametre);
108
                    $retour_tax .= afficherTaxon($valeur, $parametre);
105
                    $nbre_taxon++;
109
                    $nbre_taxon++;
106
                }
110
                }
107
            }
111
            }
108
            if ($nbre_taxon > 0) {
112
            if ($nbre_taxon > 0) {
109
                $retour .= '<ol>'."\n";
113
                $retour .= '<ol>'."\n";
110
                $retour .= $retour_tax;
114
                $retour .= $retour_tax;
111
                $retour .= '</ol>'."\n";
115
                $retour .= '</ol>'."\n";
-
 
116
            } else {
-
 
117
                $retour .= 'func_ajouterArboressenceClassif('.$donnees['etr_id_taxon_1'].')';
112
            }
118
            }
113
            
119
            
114
            $retour .= '</li>'."\n";
120
            $retour .= '</li>'."\n";
115
        }
121
        }
116
    } else {
122
    } else {
117
        $retour .= '<ol>'."\n";
123
        $retour .= '<ol>'."\n";
118
        foreach ($donnees as $cle0 => $valeur0) {
124
        foreach ($donnees as $cle0 => $valeur0) {
119
            if (strstr($cle0, $parametre)) {
125
            if (strstr($cle0, $parametre)) {
120
                if (!empty($valeur0['eni_intitule_nom'])) {
126
                if (!empty($valeur0['eni_intitule_nom'])) {
-
 
127
                    $retour .= '<li>'."\n";
121
                    $retour .= '<li><a href="{UrlFicheNom}'.$valeur0['en_id_nom'].'">';
128
                    $retour .= '<a href="func_remplacerUrlClassif('.$valeur0['etr_id_taxon_1'].')">';
-
 
129
                    $retour .= '<img src="#" alt="+"/>';
-
 
130
                    $retour .= '</a><a id="eflore_taxon_'.$valeur0['etr_id_taxon_1'].'" href="{UrlFicheNom}'.$valeur0['en_id_nom'].'">';
122
                    $retour .= $valeur0['eni_intitule_nom'];
131
                    $retour .= $valeur0['eni_intitule_nom'];
123
                    $retour .= '</a>'."\n";
132
                    $retour .= '</a>'."\n";
124
                    
133
                    
125
                    $retour_tax = '';
134
                    $retour_tax = '';
126
                    $nbre_taxon = 0;
135
                    $nbre_taxon = 0;
127
                    foreach ($valeur0 as $cle1 => $valeur1) {
136
                    foreach ($valeur0 as $cle1 => $valeur1) {
128
                        if (strstr($cle1, $parametre)) {
137
                        if (strstr($cle1, $parametre)) {
129
                            $retour_tax .= afficherTaxon($valeur1, $parametre);
138
                            $retour_tax .= afficherTaxon($valeur1, $parametre);
130
                            $nbre_taxon++;
139
                            $nbre_taxon++;
131
                        }
140
                        }
132
                    }
141
                    }
133
                    if ($nbre_taxon > 0) {
142
                    if ($nbre_taxon > 0) {
134
                        $retour .= '<ol>'."\n";
143
                        $retour .= '<ol>'."\n";
135
                        $retour .= $retour_tax;
144
                        $retour .= $retour_tax;
136
                        $retour .= '</ol>'."\n";
145
                        $retour .= '</ol>'."\n";
-
 
146
                    } else {
-
 
147
                        $retour .= 'func_ajouterArboressenceClassif('.$valeur0['etr_id_taxon_1'].')';
137
                    }
148
                    }
138
                    
149
                    
139
                    $retour .= '</li>'."\n";
150
                    $retour .= '</li>'."\n";
140
                }
151
                }
141
            }
152
            }
142
        }
153
        }
143
        $retour .= '</ol>'."\n";
154
        $retour .= '</ol>'."\n";
144
    }
155
    }
145
    return $retour;
156
    return $retour;
146
}
157
}
147
 
158
 
148
// +------------------------------------------------------------------------------------------------------+
159
// +------------------------------------------------------------------------------------------------------+
149
// |                                            PIED du PROGRAMME                                         |
160
// |                                            PIED du PROGRAMME                                         |
150
// +------------------------------------------------------------------------------------------------------+
161
// +------------------------------------------------------------------------------------------------------+
151
 
162
 
152
 
163
 
153
/* +--Fin du code ----------------------------------------------------------------------------------------+
164
/* +--Fin du code ----------------------------------------------------------------------------------------+
154
*
165
*
155
* $Log: not supported by cvs2svn $
166
* $Log: not supported by cvs2svn $
-
 
167
* Revision 1.1  2005/02/09 13:07:16  jpm
-
 
168
* Permet de voir la classification d'un taxon.
-
 
169
*
156
* Revision 1.1  2005/01/28 19:45:44  jpm
170
* Revision 1.1  2005/01/28 19:45:44  jpm
157
* Début recheche taxons.
171
* Début recheche taxons.
158
*
172
*
159
*
173
*
160
* +-- Fin du code ----------------------------------------------------------------------------------------+
174
* +-- Fin du code ----------------------------------------------------------------------------------------+
161
*/
175
*/
162
?>
176
?>