Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 455 Rev 511
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
		return $donnees;
37
		return $donnees;
37
	}
38
	}
38
 
39
 
39
	private function getChorodep() {
40
	private function getChorodep() {
40
		$this->cartes->setProjet('chorodep');
41
		$this->cartes->setProjet('chorodep');
41
		$this->cartes->setLargeur('630');
42
		$this->cartes->setLargeur('630');
42
		$id = 'nn:'.$this->nomCourant->getNnr();
43
		$id = 'nn:'.$this->nomCourant->getNnr();
43
		$this->cartes->setId($id);
44
		$this->cartes->setId($id);
44
		$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
45
		$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
45
		$chorodep['pngUrl'] = $this->cartes->getUrlPng();
46
		$chorodep['pngUrl'] = $this->cartes->getUrlPng();
46
		$chorodep['legende'] = $this->cartes->getLegendeId();
47
		$chorodep['legende'] = $this->cartes->getLegendeId();
47
		$this->meta->setProjet('chorodep');
48
		$this->meta->setProjet('chorodep');
48
		$meta = $this->meta->getMetaDonnees();
49
		$meta = $this->meta->getMetaDonnees();
49
		$citation = $meta[0]['citation'];
50
		$citation = $meta[0]['citation'];
50
		$chorodep['meta']['citation'] = $citation;
51
		$chorodep['meta']['citation'] = $citation;
51
		$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
52
		$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
52
		return $chorodep;
53
		return $chorodep;
53
	}
54
	}
54
	
55
	
55
	private function getEflore() {
56
	private function getEflore() {
56
		$this->cartes->setProjet('eflore');
57
		$this->cartes->setProjet('eflore');
57
		$this->cartes->setLargeur('max');
58
		$this->cartes->setLargeur('max');
58
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
59
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
59
		$eflore['mapUrl'] = $this->cartes->getUrlMap();
60
		$eflore['mapUrl'] = $this->cartes->getUrlMap();
60
		$eflore['legende'] = $this->cartes->getLegende();
61
		$eflore['legende'] = $this->cartes->getLegende();
61
		return $eflore;
62
		return $eflore;
62
	}
63
	}
63
 
64
 
64
	public function getBloc() {
65
	public function getBloc() {
65
		$donnees['chorodep'] = $this->getChorodepMiniature();
66
		$donnees['chorodep'] = $this->getChorodepMiniature();
66
		$donnees['eflore'] = $this->getEfloreMiniature();
67
		$donnees['eflore'] = $this->getEfloreMiniature();
67
		return $donnees;
68
		return $donnees;
68
	}
69
	}
69
	
70
	
70
	private function getChorodepMiniature() {
71
	private function getChorodepMiniature() {
71
		$this->cartes->setProjet('chorodep');
72
		$this->cartes->setProjet('chorodep');
72
		$this->cartes->setLargeur('190x178');
73
		$this->cartes->setLargeur('190x178');
73
		$id = 'nn:'.$this->nomCourant->getNnr();
74
		$id = 'nn:'.$this->nomCourant->getNnr();
74
		$this->cartes->setId($id);
75
		$this->cartes->setId($id);
75
		return $this->cartes->getUrlPng();
76
		return $this->cartes->getUrlPng();
76
	}
77
	}
77
	
78
	
78
	private function getEfloreMiniature() {
79
	private function getEfloreMiniature() {
79
		$this->cartes->setProjet('eflore');
80
		$this->cartes->setProjet('eflore');
80
		$this->cartes->setLargeur('min');
81
		$this->cartes->setLargeur('min');
81
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
82
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
82
		return $this->cartes->getUrlEflorePng();
83
		return $this->cartes->getUrlEflorePng();
83
	}
84
	}
84
}
85
}
85
?>
86
?>