Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1026 | Rev 1112 | 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
 
291 jpm 17
	private $id;
256 gduche 18
	private $largeur;
291 jpm 19
 
20
	public function setId($id) {
21
		$this->id = $id;
22
	}
23
 
24
	public function setLargeur($largeur) {
256 gduche 25
		$this->largeur = $largeur;
253 gduche 26
	}
361 delphine 27
 
28
	public function setInfoNom($nom) {
29
		$this->nom = $nom;
1026 alex 30
	}
31
 
32
	public function setInfoReferentiel($referentiel) {
33
		$this->referentiel = $referentiel;
34
	}
291 jpm 35
 
263 gduche 36
	public function getUrlDataSvg() {
291 jpm 37
		$tpl = Config::get('carteTpl');
38
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
253 gduche 39
		$url = $this->formaterUrl($tpl, $params);
40
		return $url;
41
	}
291 jpm 42
 
263 gduche 43
	public function getUrlPng() {
291 jpm 44
		$tpl = Config::get('carteTpl');
45
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
263 gduche 46
		$url = $this->formaterUrl($tpl, $params);
47
		return $url;
48
	}
361 delphine 49
 
50
	public function getUrlMap() {
51
		$tpl = Config::get('efloreCarteTpl');
52
		$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
53
				'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
366 aurelien 54
				'largeur' => $this->largeur, 'mime_type' => 'text/html');
361 delphine 55
		$url = $this->formaterUrl($tpl, $params);
56
		return $url;
57
	}
441 delphine 58
 
1026 alex 59
	public function getUrlMapSvg() {
60
		$tpl = Config::get('carteMoissonnageTpl');
61
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
62
			'largeur' => $this->largeur, 'mime_type' => 'text/html');
63
		$url = $this->formaterUrl($tpl, $params);
64
		return $url;
65
	}
66
 
67
	public function getUrlMapPng() {
68
		$tpl = Config::get('carteMoissonnageTpl');
69
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
70
				'largeur' => $this->largeur, 'mime_type' => 'image/png');
71
		$url = $this->formaterUrl($tpl, $params);
72
		return $url;
73
	}
74
 
441 delphine 75
	public function getUrlEflorePng() {
76
		$tpl = Config::get('efloreCarteTpl');
77
		$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
78
					'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
79
					'largeur' => $this->largeur, 'mime_type' => 'image/png');
80
		$url = $this->formaterUrl($tpl, $params);
81
		return $url;
82
	}
253 gduche 83
 
367 delphine 84
	public function getLegendeId() {
85
		$tpl = Config::get('legendeIdCarteTpl');
86
		$params = array('id' => $this->id);
87
		$url = $this->formaterUrl($tpl, $params);
88
		$donnees = $this->chargerDonnees($url);
89
		return $donnees;
90
	}
91
 
253 gduche 92
	public function getLegende() {
291 jpm 93
		$tpl = Config::get('legendeCarteTpl');
256 gduche 94
		$url = $this->formaterUrl($tpl, $params);
253 gduche 95
		$donnees = $this->chargerDonnees($url);
96
		return $donnees;
97
	}
98
 
1048 raphael 99
	// version statique de getUrlPng() ci-dessus
100
	static function getCarteUrlPng($projet, $id, $largeur) {
101
		return Eflore::s_formaterUrl(Config::get('carteTpl'),
102
									 array('projet' => $projet,
103
										   'id' => $id,
104
										   'largeur' => $largeur,
105
										   'mime-type' => 'image/png'));
106
	}
107
 
253 gduche 108
}
109
?>