Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 1343 → Rev 1344

/branches/v5.8-seynes/modules/fiche/formateurs/Repartition.php
18,8 → 18,6
private $nomCourant = null;
private $referentiel = 'bdtfx';
private $donnees = array();
private $tailleBloc = "190x178";
private $serviceChorodep = null;
private $cartes;
private $meta;
private $appUrls;
54,15 → 52,14
}
 
private function getRepartition() {
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
$projetRepartition = Config::get("{$this->referentiel}.baseRepartition");
// eg: eflore ou chorodep
// cf: bdtfx.ini, bdtxa.ini
if ($projetRepartition != '') {
$this->cartes->setProjet($projetRepartition);
$this->cartes->setLargeur('630');
$nt = $this->conteneur->getNomCourant()->getNt();
$referentiel = $this->conteneur->getParametre('referentiel');
$this->cartes->setId("$referentiel.nn:$nt");
$nt = $this->nomCourant->getNt();
$this->cartes->setId("{$this->referentiel}.nt:$nt");
$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
$repartition['pngUrl'] = $this->cartes->getUrlPng();
$repartition['legende'] = $this->cartes->getLegendeId();
122,13 → 119,12
// TODO: moche, comment gérer le fait que l'onglet "synthèse", en "bdtxa", doive
// afficher la carte chorologie, et non la carte chorodep.
// workaround: écrasement de l'URL dans ['répartition']['chorodep']:
if($this->referentiel == 'bdtxa') {
$syns = $this->conteneur->getApiNoms()->getSynonymes($this->nomCourant->getNnr());
$nns_syns = array_keys($syns['resultat']);
$nns_syns[] = $this->nomCourant->getNnr();
$donnees['chorodep'] = Cartes::getCarteUrlPng(Config::get($this->referentiel.'.baseRepartition'),
'nn:'.implode(',', $nns_syns),
'190x178');
if ($this->referentiel == 'bdtxa') {
$nt = $this->nomCourant->getNt();
$idCarte = "{$this->referentiel}.nt:$nt";
$urlCarte = Config::get("{$this->referentiel}.baseRepartition");
 
$donnees['chorodep'] = Cartes::getCarteUrlPng($urlCarte, $idCarte, '190x178');
}
 
return $donnees;
135,20 → 131,16
}
 
private function getChorodepMiniature() {
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
$projetRepartition = Config::get("{$this->referentiel}.baseRepartition");
$url = null;
if ($projetRepartition != "") {
if ($projetRepartition != '') {
$this->cartes->setProjet($projetRepartition);
$this->cartes->setProjet('chorodep');
$this->cartes->setLargeur('190x178');
//TODO: démochir ce code
// Chargement des nn des synonymes pour obtenir une carte plus complète
$noms = $this->conteneur->getApiNoms();
$syns = $noms->getSynonymes($this->nomCourant->getNnr());
$nns_syns = array_keys($syns['resultat']);
$nns_syns[] = $this->nomCourant->getNnr();
$id = 'nn:'.implode(',', $nns_syns);
$this->cartes->setId($id);
 
$nt = $this->nomCourant->getNt();
$this->cartes->setId("{$this->referentiel}.nt:$nt");
 
$url = $this->cartes->getUrlPng();
}
return $url;
157,7 → 149,7
private function getMoissonnageMiniature() {
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
$url = null;
if ($projetMoissonnage != "") {
if ($projetMoissonnage != '') {
$this->cartes->setProjet('moissonnage');
$this->cartes->setLargeur('190');
$this->cartes->setInfoReferentiel($this->referentiel);