Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
153 jpm 1
<?php
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 Cartographie.                                                                   |
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
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: carto_historique.class.php,v 1.1 2005-02-17 10:58:00 jpm Exp $
25
/**
26
* Classe Carto_Historique.
27
*
28
* Classe permettant de réaliser des cartes.
29
*
30
*@package Cartographie
31
//Auteur original :
32
*@author        Nicolas MATHIEU
33
//Autres auteurs :
34
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
35
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
36
*@copyright     Tela-Botanica 2000-2004
37
*@version       $Revision: 1.1 $ $Date: 2005-02-17 10:58:00 $
38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
44
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CORPS du PROGRAMME                                        |
48
// +------------------------------------------------------------------------------------------------------+
49
 
50
//==================================================================================================
51
// La classe Carto_Historique sert à pouvoir afficher les liens avec les carte précédentes
52
// On accède à cette fonctionnalité grâce à la méthode afficherHistoriqueCarte()
53
// L'objet Carto_HistoriqueCarte recoit en parametres :
54
//      -la généalogie du niveau ou on en est (du type monde*europe*france )
55
//      -l'url du document
56
//      -en option :    *le caractere de separation (par defaut c'est >)
57
//                      *la classe css des liens
58
//===================================================================================================
59
 
60
class Carto_Historique
61
{
62
    var $historique;
63
    var $url;
64
    var $caractere_separation;
65
    var $class_css;
66
    var $nom;
67
 
68
    function Carto_HistoriqueCarte ($objet_carte, $caractere = '&gt;', $class = '')
69
    {
70
        global $GS_GLOBAL;
71
 
72
        $this->historique = $objet_carte->historique;
73
        $this->url = $objet_carte->url;
74
        $this->nom = $objet_carte->nom;
75
        unset ($objet_carte);
76
        $this->caractere_separation = $caractere;
77
        $this->class_css = $class;
78
    }//Fin du constructeur Carto_HistoriqueCarte().
79
 
80
    function afficherHistoriqueCarte ()
81
    {
82
        $res='';
83
        $tabonglet = explode ('*', $this->historique);
84
        $tabnom = explode ('*', $this->nom);
85
        foreach ($tabonglet as $key=>$value) {
86
            if ($key == 0) {
87
                $chemin = $value;
88
            }
89
            else {
90
                $chemin .= '*'.$value;
91
            }
92
 
93
            $res.= '<a ';
94
 
95
            if (!empty($this->class_css)) {
96
                $res.='class="'.$this->class_css.'" ';
97
            }
98
 
99
            $res.='href="'.$this->url.'&amp;historique_cartes='.$chemin.'">&nbsp;'.$this->caractere_separation.'&nbsp;'.$tabnom[$key].'</a>';
100
        }
101
 
102
        return $res;
103
 
104
    }//Fin de la méthode afficherHistoriqueCarte().
105
 
106
}//Fin de la classe Carto_Historique.
107
 
108
 
109
// +------------------------------------------------------------------------------------------------------+
110
// |                                           LISTE de FONCTIONS                                         |
111
// +------------------------------------------------------------------------------------------------------+
112
 
113
    // +--------------------------------------------------------------------------------------------------+
114
 
115
 
116
// +------------------------------------------------------------------------------------------------------+
117
// |                                            PIED du PROGRAMME                                         |
118
// +------------------------------------------------------------------------------------------------------+
119
 
120
 
121
/* +--Fin du code ----------------------------------------------------------------------------------------+
122
*
123
* $Log: not supported by cvs2svn $
124
*
125
* +-- Fin du code ----------------------------------------------------------------------------------------+
126
*/
127
?>