Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1048 | Rev 1117 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1048 Rev 1112
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe gérant les images.
4
 * Classe gérant les images.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
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
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Cartes extends Eflore {
15
class Cartes extends Eflore {
16
 
16
 
17
	private $id;
17
	private $id;
18
	private $largeur;
18
	private $largeur;
19
 
19
 
20
	public function setId($id) {
20
	public function setId($id) {
21
		$this->id = $id;
21
		$this->id = $id;
22
	}
22
	}
23
 
23
 
24
	public function setLargeur($largeur) {
24
	public function setLargeur($largeur) {
25
		$this->largeur = $largeur;
25
		$this->largeur = $largeur;
26
	}
26
	}
27
	
27
	
28
	public function setInfoNom($nom) {
28
	public function setInfoNom($nom) {
29
		$this->nom = $nom;
29
		$this->nom = $nom;
30
	}
30
	}
31
	
31
	
32
	public function setInfoReferentiel($referentiel) {
32
	public function setInfoReferentiel($referentiel) {
33
		$this->referentiel = $referentiel;
33
		$this->referentiel = $referentiel;
34
	}
34
	}
35
 
35
 
36
	public function getUrlDataSvg() {
36
	public function getUrlDataSvg() {
37
		$tpl = Config::get('carteTpl');
37
		$tpl = Config::get('carteTpl');
38
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
38
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
39
		$url = $this->formaterUrl($tpl, $params);
39
		$url = $this->formaterUrl($tpl, $params);
40
		return $url;
40
		return $url;
41
	}
41
	}
42
 
42
 
43
	public function getUrlPng() {
43
	public function getUrlPng() {
44
		$tpl = Config::get('carteTpl');
44
		$tpl = Config::get('carteTpl');
45
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
45
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
46
		$url = $this->formaterUrl($tpl, $params);
46
		$url = $this->formaterUrl($tpl, $params);
47
		return $url;
47
		return $url;
48
	}
48
	}
49
	
49
	
50
	public function getUrlMap() {
50
	public function getUrlMap() {
51
		$tpl = Config::get('efloreCarteTpl');
51
		$tpl = Config::get('efloreCarteTpl');
52
		$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
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') ,
53
				'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
54
				'largeur' => $this->largeur, 'mime_type' => 'text/html');
54
				'largeur' => $this->largeur, 'mime_type' => 'text/html');
55
		$url = $this->formaterUrl($tpl, $params);
55
		$url = $this->formaterUrl($tpl, $params);
56
		return $url;
56
		return $url;
57
	}
57
	}
58
	
58
	
59
	public function getUrlMapSvg() {
59
	public function getUrlMapSvg() {
60
		$tpl = Config::get('carteMoissonnageTpl');
60
		$tpl = Config::get('carteMoissonnageTpl');
61
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
61
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
62
			'largeur' => $this->largeur, 'mime_type' => 'text/html');
62
			'largeur' => $this->largeur, 'mime_type' => 'text/html', 'methode' => 'afficher');
63
		$url = $this->formaterUrl($tpl, $params);
63
		$url = $this->formaterUrl($tpl, $params);
64
		return $url;
64
		return $url;
65
	}
65
	}
66
	
66
	
67
	public function getUrlMapPng() {
67
	public function getUrlMapPng() {
68
		$tpl = Config::get('carteMoissonnageTpl');
68
		$tpl = Config::get('carteMoissonnageTpl');
69
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
69
		$params = array('num_taxon' => $this->nom, 'referentiel' => $this->referentiel,
70
				'largeur' => $this->largeur, 'mime_type' => 'image/png');
70
				'largeur' => $this->largeur, 'mime_type' => 'image/png', 'methode' => 'afficher');
-
 
71
		$url = $this->formaterUrl($tpl, $params);
-
 
72
		return $url;
-
 
73
	}
-
 
74
	
-
 
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');
71
		$url = $this->formaterUrl($tpl, $params);
87
		$url = $this->formaterUrl($tpl, $params);
72
		return $url;
88
		return $url;
73
	}
89
	}
74
	
90
	
75
	public function getUrlEflorePng() {
91
	public function getUrlEflorePng() {
76
		$tpl = Config::get('efloreCarteTpl');
92
		$tpl = Config::get('efloreCarteTpl');
77
		$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
93
		$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') ,
94
					'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
79
					'largeur' => $this->largeur, 'mime_type' => 'image/png');
95
					'largeur' => $this->largeur, 'mime_type' => 'image/png');
80
		$url = $this->formaterUrl($tpl, $params);
96
		$url = $this->formaterUrl($tpl, $params);
81
		return $url;
97
		return $url;
82
	}
98
	}
83
 
99
 
84
	public function getLegendeId() {
100
	public function getLegendeId() {
85
		$tpl = Config::get('legendeIdCarteTpl');
101
		$tpl = Config::get('legendeIdCarteTpl');
86
		$params = array('id' => $this->id);
102
		$params = array('id' => $this->id);
87
		$url = $this->formaterUrl($tpl, $params);
103
		$url = $this->formaterUrl($tpl, $params);
88
		$donnees = $this->chargerDonnees($url);
104
		$donnees = $this->chargerDonnees($url);
89
		return $donnees;
105
		return $donnees;
90
	}
106
	}
91
	
107
	
92
	public function getLegende() {
108
	public function getLegende() {
93
		$tpl = Config::get('legendeCarteTpl');
109
		$tpl = Config::get('legendeCarteTpl');
94
		$url = $this->formaterUrl($tpl, $params);
110
		$url = $this->formaterUrl($tpl, $params);
95
		$donnees = $this->chargerDonnees($url);
111
		$donnees = $this->chargerDonnees($url);
96
		return $donnees;
112
		return $donnees;
97
	}
113
	}
98
 
114
 
99
	// version statique de getUrlPng() ci-dessus
115
	// version statique de getUrlPng() ci-dessus
100
	static function getCarteUrlPng($projet, $id, $largeur) {
116
	static function getCarteUrlPng($projet, $id, $largeur) {
101
		return Eflore::s_formaterUrl(Config::get('carteTpl'),
117
		return Eflore::s_formaterUrl(Config::get('carteTpl'),
102
									 array('projet' => $projet,
118
									 array('projet' => $projet,
103
										   'id' => $id,
119
										   'id' => $id,
104
										   'largeur' => $largeur,
120
										   'largeur' => $largeur,
105
										   'mime-type' => 'image/png'));
121
										   'mime-type' => 'image/png'));
106
	}
122
	}
107
 
123
 
108
}
124
}
109
?>
125
?>