Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 697 Rev 883
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe mère du module Liste.
4
 * Classe mère du module Liste.
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 Repartition extends aControleur {
15
class Repartition extends aControleur {
16
 
16
 
17
	private $conteneur = null;
17
	private $conteneur = null;
18
	private $nomCourant = null;
18
	private $nomCourant = null;
19
	private $tailleBloc = "190x178";
19
	private $tailleBloc = "190x178";
20
	private $serviceChorodep = null;
20
	private $serviceChorodep = null;
21
	private $cartes;
21
	private $cartes;
22
	private $meta;
22
	private $meta;
23
	private $appUrls;
23
	private $appUrls;
24
	
24
	
25
	public function __construct(Conteneur $conteneur) {
25
	public function __construct(Conteneur $conteneur) {
26
		$this->conteneur = $conteneur;
26
		$this->conteneur = $conteneur;
27
		$this->nomCourant = $this->conteneur->getNomCourant();
27
		$this->nomCourant = $this->conteneur->getNomCourant();
28
		$this->cartes = $this->conteneur->getApiCartes();
28
		$this->cartes = $this->conteneur->getApiCartes();
29
		$this->meta = $this->conteneur->getApiMetaDonnees();
29
		$this->meta = $this->conteneur->getApiMetaDonnees();
30
		$this->appUrls = $this->conteneur->getAppUrls();
30
		$this->appUrls = $this->conteneur->getAppUrls();
31
	}
31
	}
32
 
32
 
33
	public function obtenirDonnees() {
33
	public function obtenirDonnees() {
34
		$donnees['chorodep'] = $this->getChorodep();
34
		$donnees['chorodep'] = $this->getChorodep();
35
		$donnees['eflore'] = $this->getEflore();
35
		$donnees['eflore'] = $this->getEflore();
36
		$donnees['widget']['nt'] = $this->nomCourant->getNt();
36
		$donnees['widget']['nt'] = $this->nomCourant->getNt();
-
 
37
		$donnees['widget']['nn'] = $this->nomCourant->getNnr();
37
		return $donnees;
38
		return $donnees;
38
	}
39
	}
39
 
40
 
40
	public function obtenirDonneesExport() {
41
	public function obtenirDonneesExport() {
41
		$donnees['chorodep'] = $this->getChorodep();
42
		$donnees['chorodep'] = $this->getChorodep();
42
		$donnees['eflore'] = $this->getEfloreExport();
43
		$donnees['eflore'] = $this->getEfloreExport();
43
		return $donnees;
44
		return $donnees;
44
	}
45
	}
45
	
46
	
46
	private function getChorodep() {
47
	private function getChorodep() {
47
		$this->cartes->setProjet('chorodep');
48
		$this->cartes->setProjet('chorodep');
48
		$this->cartes->setLargeur('630');
49
		$this->cartes->setLargeur('630');
49
		$id = 'nn:'.$this->nomCourant->getNnr();
50
		$id = 'nn:'.$this->nomCourant->getNnr();
50
		$this->cartes->setId($id);
51
		$this->cartes->setId($id);
51
		$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
52
		$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
52
		$chorodep['pngUrl'] = $this->cartes->getUrlPng();
53
		$chorodep['pngUrl'] = $this->cartes->getUrlPng();
53
		$chorodep['legende'] = $this->cartes->getLegendeId();
54
		$chorodep['legende'] = $this->cartes->getLegendeId();
54
		$this->meta->setProjet('chorodep');
55
		$this->meta->setProjet('chorodep');
55
		$meta = $this->meta->getMetaDonnees();
56
		$meta = $this->meta->getMetaDonnees();
56
		$citation = $meta[0]['citation'];
57
		$citation = $meta[0]['citation'];
57
		$chorodep['meta']['citation'] = $citation;
58
		$chorodep['meta']['citation'] = $citation;
58
		$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
59
		$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
59
		return $chorodep;
60
		return $chorodep;
60
	}
61
	}
61
	
62
	
62
	private function getEflore() {
63
	private function getEflore() {
63
		$this->cartes->setProjet('eflore');
64
		$this->cartes->setProjet('eflore');
64
		$this->cartes->setLargeur('max');
65
		$this->cartes->setLargeur('max');
65
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
66
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
66
		$eflore['mapUrl'] = $this->cartes->getUrlMap();
67
		$eflore['mapUrl'] = $this->cartes->getUrlMap();
67
		$eflore['legende'] = $this->cartes->getLegende();
68
		$eflore['legende'] = $this->cartes->getLegende();
68
		return $eflore;
69
		return $eflore;
69
	}
70
	}
70
	
71
	
71
	private function getEfloreExport() {
72
	private function getEfloreExport() {
72
		$this->cartes->setProjet('eflore');
73
		$this->cartes->setProjet('eflore');
73
		$this->cartes->setLargeur('min');
74
		$this->cartes->setLargeur('min');
74
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
75
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
75
		$eflore['min'] = $this->cartes->getUrlEflorePng();
76
		$eflore['min'] = $this->cartes->getUrlEflorePng();
76
		$eflore['legende'] = $this->cartes->getLegende();
77
		$eflore['legende'] = $this->cartes->getLegende();
77
		return $eflore;
78
		return $eflore;
78
	}
79
	}
79
 
80
 
80
	public function getBloc() {
81
	public function getBloc() {
81
		$donnees['chorodep'] = $this->getChorodepMiniature();
82
		$donnees['chorodep'] = $this->getChorodepMiniature();
82
		$donnees['eflore'] = $this->getEfloreMiniature();
83
		$donnees['eflore'] = $this->getEfloreMiniature();
83
		return $donnees;
84
		return $donnees;
84
	}
85
	}
85
	
86
	
86
	private function getChorodepMiniature() {
87
	private function getChorodepMiniature() {
87
		$this->cartes->setProjet('chorodep');
88
		$this->cartes->setProjet('chorodep');
88
		$this->cartes->setLargeur('190x178');
89
		$this->cartes->setLargeur('190x178');
89
		$id = 'nn:'.$this->nomCourant->getNnr();
90
		$id = 'nn:'.$this->nomCourant->getNnr();
90
		$this->cartes->setId($id);
91
		$this->cartes->setId($id);
91
		return $this->cartes->getUrlPng();
92
		return $this->cartes->getUrlPng();
92
	}
93
	}
93
	
94
	
94
	private function getEfloreMiniature() {
95
	private function getEfloreMiniature() {
95
		$this->cartes->setProjet('eflore');
96
		$this->cartes->setProjet('eflore');
96
		$this->cartes->setLargeur('min');
97
		$this->cartes->setLargeur('min');
97
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
98
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
98
		return $this->cartes->getUrlEflorePng();
99
		return $this->cartes->getUrlEflorePng();
99
	}
100
	}
100
}
101
}
101
?>
102
?>