Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1160 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1160 Rev 1329
Line 15... Line 15...
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;
18
	private $nomCourant = null;
-
 
19
	private $donnees = array();
19
	private $donnees = array();
20
	private $referentiel = 'bdtfx';
Line 20... Line 21...
20
	private $cartes;
21
	private $cartes;
21
	
22
	
22
	public function __construct(Conteneur $conteneur) {
23
	public function __construct(Conteneur $conteneur) {
23
		$this->conteneur = $conteneur;
24
		$this->conteneur = $conteneur;
-
 
25
		$this->nomCourant = $this->conteneur->getNomCourant();
24
		$this->nomCourant = $this->conteneur->getNomCourant();
26
		$this->cartes = $this->conteneur->getApiCartes();
Line 25... Line 27...
25
		$this->cartes = $this->conteneur->getApiCartes();
27
		$this->referentiel = $this->conteneur->getParametre('referentiel');
26
	}
28
	}
27
 
29
 
28
	public function getDonnees() {
30
	public function getDonnees() {
Line 29... Line 31...
29
		$donnees['chorodep'] = $this->getChorodepMiniature();
31
		$donnees['carte'] = $this->getChorodepMiniature();
-
 
32
		return $donnees;
-
 
33
	}
30
		return $donnees;
34
	
31
	}
35
	private function getChorodepMiniature() {
32
	
36
		$url_carte = null;
33
	private function getChorodepMiniature() {
37
		if(Config::get($this->referentiel.'.baseRepartition') != null) {
34
		$this->cartes->setProjet('chorodep');
38
			$this->cartes->setProjet(Config::get($this->referentiel.'.baseRepartition'));
35
		$this->cartes->setLargeur('570x534');
39
			$this->cartes->setLargeur('570x534');
36
		//TODO: démochir ce code
40
			//TODO: démochir ce code
37
		// Chargement des nn des synonymes pour obtenir une carte plus complète
41
			// Chargement des nn des synonymes pour obtenir une carte plus complète
38
		$noms = $this->conteneur->getApiNoms();
42
			$noms = $this->conteneur->getApiNoms();
39
		$syns = $noms->getSynonymes($this->nomCourant->getNnr());
43
			$syns = $noms->getSynonymes($this->nomCourant->getNnr());
40
		$nns_syns = array_keys($syns['resultat']);
44
			$nns_syns = array_keys($syns['resultat']);
-
 
45
			$nns_syns[] = $this->nomCourant->getNnr();
-
 
46
			$id = 'nn:'.implode(',', $nns_syns);
41
		$nns_syns[] = $this->nomCourant->getNnr();
47
			$this->cartes->setId($id);
42
		$id = 'nn:'.implode(',', $nns_syns);
48
			$url_carte = $this->cartes->getUrlDataSvg();
43
		$this->cartes->setId($id);
49
		}
44
		return $this->cartes->getUrlDataSvg();
50
		return $url_carte;