Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 256 | Go to most recent revision | Details | 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
19
 
20
	public function __Construct($numero, $type = 'nt') {
21
		$this->type = $type;
22
		$this->numero = $numero;
23
	}
24
 
25
	public function getUrlImage() {
26
		switch ($this->type) {
27
			case 'nn' :
28
				$nomTemplate = 'urlChorologieParNnTpl';
29
			break;
30
			case 'nt' :
31
				$nomTemplate = 'urlChorologieParNtTpl';
32
			break;
33
		}
34
		$tpl = Config::get($nomTemplate);
35
		$params = array($this->type => $this->numero);
36
		$url = $this->formaterUrl($tpl, $params);
37
 
38
		return $url;
39
	}
40
 
41
	public function getLegende() {
42
		switch ($this->type) {
43
			case 'nn' :
44
				$nomTemplate = 'urlChorologieParNnTpl';
45
			break;
46
			case 'nt' :
47
				$nomTemplate = 'urlChorologieParNtTpl';
48
			break;
49
		}
50
		$tpl = Config::get($nomTemplate);
51
		$params = array($this->type => $this->numero);
52
		$url = $this->formaterUrl($tpl."/legende", $params);
53
		$donnees = $this->chargerDonnees($url);
54
		return $donnees;
55
	}
56
 
57
}
58
?>