Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 476 Rev 495
Line 11... Line 11...
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
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
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Images extends Eflore {
15
class Images extends Eflore {
16
	
16
 
17
	//TODO: créer des fonctions spécifiques cel et photoflora pour plus de clarté ?
17
	//TODO: créer des fonctions spécifiques cel et photoflora pour plus de clarté ?
18
	public function getUrlsImagesParIdsNoms(Array $idsNoms) {
18
	public function getUrlsImagesParIdsNoms(Array $idsNoms) {
19
		$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
19
		$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
20
		$urls = array();
20
		$urls = array();
21
		foreach ($infosImages['resultats'] as $img) {
21
		foreach ($infosImages['resultats'] as $img) {
Line 25... Line 25...
25
		return $urls;
25
		return $urls;
26
	}
26
	}
Line 27... Line 27...
27
 
27
 
28
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
28
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
29
		$url = $this->getUrlImagesParIdsNoms($idsNoms);
29
		$url = $this->getUrlImagesParIdsNoms($idsNoms);
-
 
30
		$donnees = $this->chargerDonnees($url);
-
 
31
		$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
30
		return $this->chargerDonnees($url);
32
		return $images;
31
	}
33
	}
32
	
34
 
33
	public function getInfosImageParIdImage($id_image) {
35
	public function getInfosImageParIdImage($id_image) {
34
		$tpl = Config::get('imagesPopupTpl');
36
		$tpl = Config::get('imagesPopupTpl');
35
		$url = $this->formaterUrl($tpl, array('id'=>$id_image));
37
		$url = $this->formaterUrl($tpl, array('id' => $id_image));
36
		return $this->chargerDonnees($url);
38
		return $this->chargerDonnees($url);
Line 37... Line 39...
37
	}
39
	}
38
 
40
 
39
	private function getUrlImagesParIdsNoms($idsNoms) {
41
	private function getUrlImagesParIdsNoms($idsNoms) {
40
		$tpl = Config::get('imagesResultatsDeterminationTpl');
42
		$tpl = Config::get('imagesResultatsDeterminationTpl');
41
		$params = array('idsNoms' => implode(',', $idsNoms));
43
		$params = array('idsNoms' => implode(',', $idsNoms));
42
		$url = $this->formaterUrl($tpl, $params);
44
		$url = $this->formaterUrl($tpl, $params);
43
		return $url;
45
		return $url;
44
	}
46
	}
45
	
47
 
46
	public function getUrlPremiereImageParIdsNoms($idsNoms) {
48
	public function getUrlPremiereImageParIdsNoms($idsNoms) {
47
		$tpl = Config::get('imagesFicheBlocTpl');
49
		$tpl = Config::get('imagesFicheBlocTpl');
48
		$params = array('idsNoms' => implode(',', $idsNoms));
50
		$params = array('idsNoms' => implode(',', $idsNoms));