Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1285 | Details | Compare with Previous | Last modification | View Log | RSS feed

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