Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev Author Line No. Line
253 gduche 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe gérant les images.
5
 *
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
14
 */
15
class Cartes extends Eflore {
16
 
17
	private $numero;
18
	private $type; //nt taxonomique ou nn nomenclatural
256 gduche 19
	private $largeur;
253 gduche 20
 
256 gduche 21
	public function __Construct($numero, $type = 'nt', $largeur = 630) {
253 gduche 22
		$this->type = $type;
23
		$this->numero = $numero;
256 gduche 24
		$this->largeur = $largeur;
253 gduche 25
	}
26
 
27
	public function getUrlImage() {
28
		switch ($this->type) {
29
			case 'nn' :
30
				$nomTemplate = 'urlChorologieParNnTpl';
31
			break;
32
			case 'nt' :
33
				$nomTemplate = 'urlChorologieParNtTpl';
34
			break;
35
		}
36
		$tpl = Config::get($nomTemplate);
256 gduche 37
		$params = array($this->type => $this->numero, 'largeur' => $this->largeur);
253 gduche 38
		$url = $this->formaterUrl($tpl, $params);
39
		return $url;
40
	}
41
 
42
	public function getLegende() {
43
		switch ($this->type) {
44
			case 'nn' :
256 gduche 45
				$nomTemplate = 'legendeChorologieParNnTpl';
253 gduche 46
			break;
47
			case 'nt' :
256 gduche 48
				$nomTemplate = 'legendeChorologieParNtTpl';
253 gduche 49
			break;
50
		}
51
		$tpl = Config::get($nomTemplate);
52
		$params = array($this->type => $this->numero);
256 gduche 53
		$url = $this->formaterUrl($tpl, $params);
253 gduche 54
		$donnees = $this->chargerDonnees($url);
55
		return $donnees;
56
	}
57
 
58
}
59
?>