Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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