| Line 14... |
Line 14... |
| 14 |
*/
|
14 |
*/
|
| 15 |
class Repartition extends aControleur {
|
15 |
class Repartition extends aControleur {
|
| Line 16... |
Line 16... |
| 16 |
|
16 |
|
| 17 |
private $conteneur = null;
|
17 |
private $conteneur = null;
|
| - |
|
18 |
private $nomCourant = null;
|
| - |
|
19 |
private $referentiel = 'bdtfx';
|
| 18 |
private $nomCourant = null;
|
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;
|
| Line 23... |
Line 25... |
| 23 |
private $appUrls;
|
25 |
private $appUrls;
|
| 24 |
|
26 |
|
| 25 |
public function __construct(Conteneur $conteneur) {
|
27 |
public function __construct(Conteneur $conteneur) {
|
| - |
|
28 |
$this->conteneur = $conteneur;
|
| 26 |
$this->conteneur = $conteneur;
|
29 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
| 27 |
$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();
|
| Line 30... |
Line 33... |
| 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();
|
| Line 37... |
Line 40... |
| 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() {
|
| Line 42... |
Line 45... |
| 42 |
$donnees['chorodep'] = $this->getChorodep();
|
45 |
$donnees['chorodep'] = $this->getRepartition();
|
| - |
|
46 |
$donnees['eflore'] = $this->getMoissonnageExport();
|
| - |
|
47 |
return $donnees;
|
| 43 |
$donnees['eflore'] = $this->getEfloreExport();
|
48 |
}
|
| 44 |
return $donnees;
|
49 |
|
| 45 |
}
|
50 |
private function getRepartition() {
|
| 46 |
|
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);
|
| - |
|
61 |
$meta = $this->meta->getMetaDonnees();
|
| 56 |
$meta = $this->meta->getMetaDonnees();
|
62 |
$citation = $meta[0]['citation'];
|
| Line 57... |
Line 63... |
| 57 |
$citation = $meta[0]['citation'];
|
63 |
$repartition['meta']['citation'] = $citation;
|
| - |
|
64 |
$repartition['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projetRepartition);
|
| - |
|
65 |
$this->donnees['repartition'] = $repartition;
|
| 58 |
$chorodep['meta']['citation'] = $citation;
|
66 |
}
|
| 59 |
$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
|
67 |
}
|
| 60 |
return $chorodep;
|
68 |
|
| 61 |
}
|
69 |
private function getMoissonnage() {
|
| 62 |
|
70 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
| 63 |
private function getEflore() {
|
71 |
if ($projetMoissonnage != "") {
|
| - |
|
72 |
$this->cartes->setProjet('eflore');
|
| 64 |
$this->cartes->setProjet('eflore');
|
73 |
$this->cartes->setLargeur('max');
|
| Line 65... |
Line 74... |
| 65 |
$this->cartes->setLargeur('max');
|
74 |
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
|
| 66 |
$this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
|
75 |
$eflore['mapUrl'] = $this->cartes->getUrlMap();
|
| 67 |
$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 |
}
|