Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 698 Rev 898
Line 42... Line 42...
42
		}
42
		}
43
		return $urls;
43
		return $urls;
44
	}
44
	}
Line 45... Line 45...
45
 
45
 
-
 
46
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
-
 
47
		$pas = 800;
-
 
48
		if(count($idsNoms) >= $pas) {
-
 
49
			$images = array();
-
 
50
			$idsPartages = array_chunk($idsNoms, $pas);
-
 
51
			foreach ($idsPartages as $sousEnsembleIdsNoms) {
-
 
52
				$url = $this->getUrlImagesParIdsNoms($sousEnsembleIdsNoms);
-
 
53
				$donnees = $this->chargerDonnees($url);
-
 
54
				$resultats = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
-
 
55
				$images += $resultats;
-
 
56
			}
46
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
57
		} else {
47
		$url = $this->getUrlImagesParIdsNoms($idsNoms);
58
			$url = $this->getUrlImagesParIdsNoms($idsNoms);
48
		$donnees = $this->chargerDonnees($url);
59
			$donnees = $this->chargerDonnees($url);
-
 
60
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
49
		$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
61
		}
50
		return $images;
62
		return $images;
Line 51... Line 63...
51
	}
63
	}
52
 
64
 
Line 60... Line 72...
60
		$url = $this->getUrlImages();
72
		$url = $this->getUrlImages();
61
		$donnees = $this->chargerDonnees($url); 
73
		$donnees = $this->chargerDonnees($url); 
62
		$images = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
74
		$images = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
63
		return $images;
75
		return $images;
64
	}
76
	}
65
	
77
 
66
	public function getInfosImagesTaxons() {
78
	public function getInfosImagesTaxons() {
-
 
79
		$pas = 800;
-
 
80
		$idsTaxons = explode(',', $this->nntaxon);
-
 
81
		if(count($idsTaxons) >= $pas) {
-
 
82
			$images = array();
-
 
83
			$idsPartages = array_chunk($idsTaxons, $pas);
-
 
84
			foreach ($idsPartages as $sousEnsembleIdsTaxons) {
-
 
85
				$url = $this->getUrlImagesTaxons(implode(',',$sousEnsembleIdsTaxons));
-
 
86
				$donnees = $this->chargerDonnees($url);
-
 
87
				$resultats = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
-
 
88
				$images += $resultats;
-
 
89
			}
-
 
90
		} else {
67
		$url = $this->getUrlImagesTaxons();
91
			$url = $this->getUrlImagesTaxons($idsTaxons);
68
		$donnees = $this->chargerDonnees($url);
92
			$donnees = $this->chargerDonnees($url);
69
		$images = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
93
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
-
 
94
		}
70
		return $images;
95
		return $images;
71
	}
96
	}
72
 
-
 
73
 
97
	
74
	private function getUrlImagesParIdsNoms($idsNoms) {
98
	private function getUrlImagesParIdsNoms($idsNoms) {
75
		$tpl = Config::get('imagesResultatsDeterminationTpl');
99
		$tpl = Config::get('imagesResultatsDeterminationTpl');
76
		$params = array('idsNoms' => implode(',', $idsNoms));
100
		$params = array('idsNoms' => implode(',', $idsNoms));
77
		$url = $this->formaterUrl($tpl, $params);
101
		$url = $this->formaterUrl($tpl, $params);
78
		return $url;
102
		return $url;
Line 92... Line 116...
92
		$params = array('projet' => $this->getProjet(), 'limite' => $this->limite, 'depart' => $this->depart);
116
		$params = array('projet' => $this->getProjet(), 'limite' => $this->limite, 'depart' => $this->depart);
93
		$url = $this->formaterUrl($tpl, $params);
117
		$url = $this->formaterUrl($tpl, $params);
94
		return $url;
118
		return $url;
95
	}
119
	}
Line 96... Line 120...
96
	
120
	
97
	private function getUrlImagesTaxons() {
121
	private function getUrlImagesTaxons($idsTaxons) {
98
		$tpl = Config::get('imagesTaxonsTpl');
122
		$tpl = Config::get('imagesTaxonsTpl');
99
		$params = array('projet' => $this->getProjet(),'nntaxon'=> $this->nntaxon);
123
		$params = array('projet' => $this->getProjet(),'nntaxon'=> $idsTaxons);
100
		$url = $this->formaterUrl($tpl, $params);
124
		$url = $this->formaterUrl($tpl, $params);
101
		return $url;
125
		return $url;
102
	}
126
	}
103
}
127
}
104
?>
128
?>