New file |
0,0 → 1,132 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.3 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Cartographie. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: carto_historique.class.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $ |
/** |
* Classe Carto_Historique. |
* |
* Classe permettant de réaliser des cartes. |
* |
*@package Cartographie |
//Auteur original : |
*@author Nicolas MATHIEU |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
/** |
* Classe Carto_Historique() - Affiche les liens avec les carte précédentes. |
* |
* La classe Carto_Historique sert à pouvoir afficher les liens avec les carte précédentes |
* On accède à cette fonctionnalité grâce à la méthode afficherHistoriqueCarte() |
* L'objet Carto_HistoriqueCarte recoit en parametres : |
* - la généalogie du niveau ou on en est (du type monde*europe*france ) |
* - l'url du document |
* - en option : - le caractere de separation (par defaut c'est >) |
* - la classe css des liens |
*/ |
class Carto_Historique |
{ |
// +--------------------------------------------------------------------------------------------------+ |
// LES ATTRIBUTS DE LA CLASSE |
var $historique; |
var $url; |
var $caractere_separation; |
var $class_css; |
var $nom; |
|
// +--------------------------------------------------------------------------------------------------+ |
// LE CONSTRUCTEUR DE LA CLASSE |
/** |
* Constructeur Carto_Historique() |
* |
* Constructeur initialisant les attributs de la classe Carto_Historique(). |
*/ |
function Carto_Historique($objet_carte, $caractere = '>', $class = '') |
{ |
$this->historique = $objet_carte->historique; |
$this->url = $objet_carte->url; |
$this->nom = $objet_carte->nom; |
unset ($objet_carte); |
$this->caractere_separation = $caractere; |
$this->class_css = $class; |
}//Fin du constructeur Carto_Historique(). |
|
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PUBLIQUES |
function afficherHistoriqueCarte() |
{ |
$res=''; |
$tabonglet = explode ('*', $this->historique); |
$tabnom = explode ('*', $this->nom); |
foreach ($tabonglet as $key=>$value) { |
if ($key == 0) { |
$chemin = $value; |
} |
else { |
$chemin .= '*'.$value; |
} |
|
$res.= '<a '; |
|
if (!empty($this->class_css)) { |
$res.='class="'.$this->class_css.'" '; |
} |
|
$res.='href="'.$this->url.'&historique_cartes='.$chemin.'"> '.$this->caractere_separation.' '.$tabnom[$key].'</a>'; |
} |
|
return $res; |
|
}//Fin de la méthode afficherHistoriqueCarte(). |
|
}//Fin de la classe Carto_Historique. |
|
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
|
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.1 2005/02/28 15:03:49 jpm |
* Ajout des fichiers de la bibliothèque cartographique. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |