Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 279 Rev 311
Line 12... Line 12...
12
	private $imagesService = null;
12
	private $imagesService = null;
Line 13... Line 13...
13
 
13
 
14
	private $motsASurligner = array();
14
	private $motsASurligner = array();
15
	private $noms = array();
15
	private $noms = array();
16
	private $infosPourTpl = array();
16
	private $infosPourTpl = array();
17
	
17
 
18
	public function __construct(ParametresResultats $parametres, Array $resultats,
18
	public function __construct(ParametresResultats $parametres, Array $resultats,
19
		Surligneur $surligneur = null, Trieur $trieur = null, AppUrls $urls = null,
19
		Surligneur $surligneur = null, Trieur $trieur = null, AppUrls $urls = null,
Line 20... Line 20...
20
		ChaineManipulateur $manipulateurDeChaine = null, Images $imagesService = null) {
20
		ChaineManipulateur $manipulateurDeChaine = null, Images $imagesService = null) {
Line 47... Line 47...
47
 
47
 
Line 48... Line 48...
48
		$urls = $this->imagesService->getUrlsImagesParIdsNoms($ids);
48
		$urls = $this->imagesService->getUrlsImagesParIdsNoms($ids);
49
 
49
 
50
		$this->infosPourTpl['imagesUrls'] = $this->supprimerCodeReftaxDesIds($urls);
-
 
-
 
50
		$this->infosPourTpl['imagesUrls'] = $this->supprimerCodeReftaxDesIds($urls);
51
	}
51
	}
-
 
52
	// TODO : utiliser le conteneur pour charger tous les objets de cette classe
52
 
53
	private function chargerRepartition() {
-
 
54
		$conteneur = new Conteneur();
-
 
55
		$cartesWs = $conteneur->getApiCartes();
-
 
56
		$cartesWs->setProjet('chorodep');
-
 
57
		$cartesWs->setLargeur('108x101');
-
 
58
		$urls = array();
53
	private function chargerRepartition() {
59
		foreach ($this->noms as $id => $nom) {
-
 
60
			if (array_key_exists('nom_retenu.id', $nom)) {
54
		$premierNom = current($this->noms);
61
				$id = $nom['nom_retenu.id'];
55
		$nomRetenuId = $premierNom['nom_retenu.id'];
62
				$cartesWs->setId("nn:$id");
-
 
63
				if (array_key_exists($id, $urls) == false) {
-
 
64
					$urls[$id] = $cartesWs->getUrlPng();
-
 
65
				}
56
		$serviceRepartition = new Cartes('chorodep', $nomRetenuId, 'nn', "108x101");
66
			}
57
		$urlPng = $serviceRepartition->getUrlPng();
67
		}
58
		$this->infosPourTpl['repartition_vignette'] = $urlPng;	
68
		$this->infosPourTpl['repartition']['urls'] = $urls;
59
	}
69
	}
60
	
70
 
61
	private function extraireIdDesNoms() {
71
	private function extraireIdDesNoms() {
62
		$ids = array();
72
		$ids = array();
63
		foreach ($this->noms as $id => $nom) {
73
		foreach ($this->noms as $id => $nom) {
Line 76... Line 86...
76
		}
86
		}
77
		return $ids;
87
		return $ids;
78
	}
88
	}
Line 79... Line 89...
79
 
89
 
80
	private function supprimerCodeReftaxDesIds($urls) {
-
 
81
		$codeReftax = $this->parametres->reftaxCourant.'.';
90
	private function supprimerCodeReftaxDesIds($urls) {
82
		$urlsNettoyees = array();
91
		$urlsNettoyees = array();
83
		foreach ($urls as $id => $url) {
92
		foreach ($urls as $id => $url) {
84
			$id = str_replace($codeReftax, '', $id);
93
			$id = $this->supprimerCodeReftax($id);
85
			$urlsNettoyees[$id] = $url;
94
			$urlsNettoyees[$id] = $url;
86
		}
95
		}
87
		return $urlsNettoyees;
96
		return $urlsNettoyees;
Line -... Line 97...
-
 
97
	}
-
 
98
 
-
 
99
	private function supprimerCodeReftax($chaine) {
-
 
100
		$codeReftax = $this->parametres->reftaxCourant.'.';
-
 
101
		$chaine = str_replace($codeReftax, '', $chaine);
-
 
102
		return $chaine;
88
	}
103
	}
89
 
104
 
90
	private function extraireInfosNomsPourTplDetermination() {
105
	private function extraireInfosNomsPourTplDetermination() {
91
		$nomsSansCorrespondance = array();
106
		$nomsSansCorrespondance = array();
92
		$nomsAvecCorrespondance = array();
107
		$nomsAvecCorrespondance = array();