Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 883 Rev 952
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 $referentiel = 'bdtfx';
-
 
20
	private $donnees = array();
19
	private $tailleBloc = "190x178";
21
	private $tailleBloc = "190x178";
20
	private $serviceChorodep = null;
22
	private $serviceChorodep = null;
21
	private $cartes;
23
	private $cartes;
22
	private $meta;
24
	private $meta;
23
	private $appUrls;
25
	private $appUrls;
24
	
26
	
25
	public function __construct(Conteneur $conteneur) {
27
	public function __construct(Conteneur $conteneur) {
26
		$this->conteneur = $conteneur;
28
		$this->conteneur = $conteneur;
27
		$this->nomCourant = $this->conteneur->getNomCourant();
29
		$this->nomCourant = $this->conteneur->getNomCourant();
-
 
30
		$this->referentiel = $this->conteneur->getParametre('referentiel');
28
		$this->cartes = $this->conteneur->getApiCartes();
31
		$this->cartes = $this->conteneur->getApiCartes();
29
		$this->meta = $this->conteneur->getApiMetaDonnees();
32
		$this->meta = $this->conteneur->getApiMetaDonnees();
30
		$this->appUrls = $this->conteneur->getAppUrls();
33
		$this->appUrls = $this->conteneur->getAppUrls();
31
	}
34
	}
32
 
35
 
33
	public function obtenirDonnees() {
36
	public function obtenirDonnees() {
34
		$donnees['chorodep'] = $this->getChorodep();
37
		$this->getRepartition();
35
		$donnees['eflore'] = $this->getEflore();
38
		$this->getMoissonnage();
36
		$donnees['widget']['nt'] = $this->nomCourant->getNt();
39
		$this->donnees['widget']['nt'] = $this->nomCourant->getNt();
37
		$donnees['widget']['nn'] = $this->nomCourant->getNnr();
40
		$this->donnees['widget']['nn'] = $this->nomCourant->getNnr();
38
		return $donnees;
41
		return $this->donnees;
39
	}
42
	}
40
 
43
 
41
	public function obtenirDonneesExport() {
44
	public function obtenirDonneesExport() {
42
		$donnees['chorodep'] = $this->getChorodep();
45
		$donnees['chorodep'] = $this->getRepartition();
43
		$donnees['eflore'] = $this->getEfloreExport();
46
		$donnees['eflore'] = $this->getMoissonnageExport();
44
		return $donnees;
47
		return $donnees;
45
	}
48
	}
46
	
49
	
-
 
50
	private function getRepartition() {
-
 
51
		$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
47
	private function getChorodep() {
52
		if ($projetRepartition != "") {
48
		$this->cartes->setProjet('chorodep');
53
			$this->cartes->setProjet($projetRepartition);
49
		$this->cartes->setLargeur('630');
54
			$this->cartes->setLargeur('630');
50
		$id = 'nn:'.$this->nomCourant->getNnr();
55
			$id = 'nn:'.$this->nomCourant->getNnr();
51
		$this->cartes->setId($id);
56
			$this->cartes->setId($id);
52
		$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
57
			$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
53
		$chorodep['pngUrl'] = $this->cartes->getUrlPng();
58
			$repartition['pngUrl'] = $this->cartes->getUrlPng();
54
		$chorodep['legende'] = $this->cartes->getLegendeId();
59
			$repartition['legende'] = $this->cartes->getLegendeId();
55
		$this->meta->setProjet('chorodep');
60
			$this->meta->setProjet($projetRepartition);
56
		$meta = $this->meta->getMetaDonnees();
61
			$meta = $this->meta->getMetaDonnees();
57
		$citation = $meta[0]['citation'];
62
			$citation = $meta[0]['citation'];
58
		$chorodep['meta']['citation'] = $citation;
63
			$repartition['meta']['citation'] = $citation;
59
		$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
64
			$repartition['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projetRepartition);
-
 
65
			$this->donnees['repartition'] = $repartition;
60
		return $chorodep;
66
		}
61
	}
67
	}
-
 
68
	
-
 
69
	private function getMoissonnage() {
62
	
70
		$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
63
	private function getEflore() {
71
		if ($projetMoissonnage != "") {
64
		$this->cartes->setProjet('eflore');
72
			$this->cartes->setProjet('eflore');
65
		$this->cartes->setLargeur('max');
73
			$this->cartes->setLargeur('max');
66
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
74
			$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
67
		$eflore['mapUrl'] = $this->cartes->getUrlMap();
75
			$eflore['mapUrl'] = $this->cartes->getUrlMap();
-
 
76
			$eflore['legende'] = $this->cartes->getLegende();
68
		$eflore['legende'] = $this->cartes->getLegende();
77
			$this->donnees['moissonnage'] = $eflore;
69
		return $eflore;
78
		}
70
	}
79
	}
71
	
80
	
72
	private function getEfloreExport() {
81
	private function getMoissonnageExport() {
73
		$this->cartes->setProjet('eflore');
82
		$this->cartes->setProjet('eflore');
74
		$this->cartes->setLargeur('min');
83
		$this->cartes->setLargeur('min');
75
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
84
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
76
		$eflore['min'] = $this->cartes->getUrlEflorePng();
85
		$eflore['min'] = $this->cartes->getUrlEflorePng();
77
		$eflore['legende'] = $this->cartes->getLegende();
86
		$eflore['legende'] = $this->cartes->getLegende();
78
		return $eflore;
87
		return $eflore;
79
	}
88
	}
80
 
89
 
81
	public function getBloc() {
90
	public function getBloc() {
82
		$donnees['chorodep'] = $this->getChorodepMiniature();
91
		$donnees['chorodep'] = $this->getChorodepMiniature();
83
		$donnees['eflore'] = $this->getEfloreMiniature();
92
		$donnees['eflore'] = $this->getEfloreMiniature();
84
		return $donnees;
93
		return $donnees;
85
	}
94
	}
86
	
95
	
87
	private function getChorodepMiniature() {
96
	private function getChorodepMiniature() {
88
		$this->cartes->setProjet('chorodep');
97
		$this->cartes->setProjet('chorodep');
89
		$this->cartes->setLargeur('190x178');
98
		$this->cartes->setLargeur('190x178');
90
		$id = 'nn:'.$this->nomCourant->getNnr();
99
		$id = 'nn:'.$this->nomCourant->getNnr();
91
		$this->cartes->setId($id);
100
		$this->cartes->setId($id);
92
		return $this->cartes->getUrlPng();
101
		return $this->cartes->getUrlPng();
93
	}
102
	}
94
	
103
	
95
	private function getEfloreMiniature() {
104
	private function getEfloreMiniature() {
96
		$this->cartes->setProjet('eflore');
105
		$this->cartes->setProjet('eflore');
97
		$this->cartes->setLargeur('min');
106
		$this->cartes->setLargeur('min');
98
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
107
		$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
99
		return $this->cartes->getUrlEflorePng();
108
		return $this->cartes->getUrlEflorePng();
100
	}
109
	}
101
}
110
}
102
?>
111
?>