Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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
 
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,
1112 aurelien 62
			'largeur' => $this->largeur, 'mime_type' => 'text/html', 'methode' => 'afficher');
1026 alex 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,
1112 aurelien 70
				'largeur' => $this->largeur, 'mime_type' => 'image/png', 'methode' => 'afficher');
1026 alex 71
		$url = $this->formaterUrl($tpl, $params);
72
		return $url;
73
	}
74
 
1112 aurelien 75
	public function getUrlTelechargementMapPng() {
76
		$tpl = Config::get('carteMoissonnageTpl');
77
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
78
					'largeur' => $this->largeur, 'mime_type' => 'image/png', 'methode' => 'telecharger');
79
		$url = $this->formaterUrl($tpl, $params);
80
		return $url;
81
	}
82
 
83
	public function getUrlTelechargementMapHtml() {
84
		$tpl = Config::get('carteMoissonnageTpl');
85
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
86
			'largeur' => $this->largeur, 'mime_type' => 'text/html', 'methode' => 'telecharger');
87
		$url = $this->formaterUrl($tpl, $params);
88
		return $url;
89
	}
90
 
441 delphine 91
	public function getUrlEflorePng() {
92
		$tpl = Config::get('efloreCarteTpl');
93
		$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
94
					'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
95
					'largeur' => $this->largeur, 'mime_type' => 'image/png');
96
		$url = $this->formaterUrl($tpl, $params);
97
		return $url;
98
	}
253 gduche 99
 
367 delphine 100
	public function getLegendeId() {
101
		$tpl = Config::get('legendeIdCarteTpl');
102
		$params = array('id' => $this->id);
103
		$url = $this->formaterUrl($tpl, $params);
104
		$donnees = $this->chargerDonnees($url);
105
		return $donnees;
106
	}
107
 
253 gduche 108
	public function getLegende() {
291 jpm 109
		$tpl = Config::get('legendeCarteTpl');
1117 delphine 110
		$url = $this->formaterUrl($tpl, array());
253 gduche 111
		$donnees = $this->chargerDonnees($url);
112
		return $donnees;
113
	}
114
 
1048 raphael 115
	// version statique de getUrlPng() ci-dessus
116
	static function getCarteUrlPng($projet, $id, $largeur) {
117
		return Eflore::s_formaterUrl(Config::get('carteTpl'),
118
									 array('projet' => $projet,
119
										   'id' => $id,
120
										   'largeur' => $largeur,
121
										   'mime-type' => 'image/png'));
122
	}
123
 
253 gduche 124
}
125
?>