Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 593 Rev 617
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();
Line 16... Line 17...
16
	private $infosPourTpl = array();
17
	
17
 
18
 
18
	public function __construct(ParametresResultats $parametres, Array $resultats,
19
	public function __construct(ParametresResultats $parametres, Array $resultats,
Line 35... Line 36...
35
	public function getTplNom() {
36
	public function getTplNom() {
36
		return self::TPL_VUE;
37
		return self::TPL_VUE;
37
	}
38
	}
Line 38... Line 39...
38
 
39
 
-
 
40
	public function formater() {
39
	public function formater() {
41
		$this->obtenirUrlsImagesCoste();
40
		$this->obtenirUrlsPhotos();
42
		$this->obtenirUrlsPhotos();
41
		$this->chargerRepartition();
43
		$this->chargerRepartition();
-
 
44
		$this->extraireInfosNomsPourTplDetermination();
42
		$this->extraireInfosNomsPourTplDetermination();
45
			
Line 43... Line 46...
43
	}
46
	}
-
 
47
 
44
 
48
	private function obtenirUrlsPhotos() {
45
	private function obtenirUrlsPhotos() {
49
		$this->imagesService->setProjet('cel');
46
		$ids = $this->extraireIdDesNoms();
50
		$ids = $this->extraireIdDesNoms();
47
		$urls = $this->imagesService->getUrlsImagesParIdsNoms($ids);
51
		$urls = $this->imagesService->getUrlsImagesParIdsNoms($ids);
-
 
52
		$this->infosPourTpl['imagesUrls'] = $this->supprimerCodeReftaxDesIds($urls);
-
 
53
	}
-
 
54
	
-
 
55
	private function obtenirUrlsImagesCoste() {
-
 
56
		$this->extraireInfosTaxons();
-
 
57
		$this->imagesService->setProjet('coste');
-
 
58
		foreach ($this->infosPourTpl['taxons'] as $nn => $tax) {
-
 
59
			$this->imagesService->setNnTaxon($tax);
-
 
60
			$costeImg = $this->imagesService->getInfosImagesTaxons();
-
 
61
			if (!empty($costeImg)) {
-
 
62
				foreach ($costeImg as  $infos) {
-
 
63
					$num_taxon = $infos['num_taxonomique'];
-
 
64
					$images[$num_taxon][] = $infos['binaire.href'];
-
 
65
					$this->infosPourTpl['imagesCoste'] = $images;
-
 
66
				}
-
 
67
			}
-
 
68
		}
Line -... Line 69...
-
 
69
		
-
 
70
	}
-
 
71
 
-
 
72
	private function extraireInfosTaxons() {
-
 
73
		foreach ($this->noms as $id => $nom ) {
-
 
74
			if (array_key_exists('num_taxonomique', $nom)) {
-
 
75
				$this->infosPourTpl['taxons'][$id] = $nom['num_taxonomique'];
-
 
76
			}
48
		$this->infosPourTpl['imagesUrls'] = $this->supprimerCodeReftaxDesIds($urls);
77
		}
49
	}
78
	}
50
 
79
	
51
	// TODO : utiliser le conteneur pour charger tous les objets de cette classe
80
	// TODO : utiliser le conteneur pour charger tous les objets de cette classe
52
	private function chargerRepartition() {
81
	private function chargerRepartition() {
Line 65... Line 94...
65
			}
94
			}
66
		}
95
		}
67
		$this->infosPourTpl['repartition']['urls'] = $urls;
96
		$this->infosPourTpl['repartition']['urls'] = $urls;
68
	}
97
	}
Line -... Line 98...
-
 
98
 
-
 
99
 
-
 
100
 
69
 
101
	
70
	private function extraireIdDesNoms() {
102
	private function extraireIdDesNoms() {
71
		$ids = array();
103
		$ids = array();
72
		foreach ($this->noms as $id => $nom) {
104
		foreach ($this->noms as $id => $nom) {
73
			$idAAjouter = $id;
105
			$idAAjouter = $id;