Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 130 | Rev 339 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 130 Rev 317
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe gérant les images.
4
 * Classe gérant les images.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 Tela-Botanica
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
	public function getUrlsImagesParIdsNoms(Array $idsNoms) {
17
	public function getUrlsImagesParIdsNoms(Array $idsNoms) {
18
		$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
18
		$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
19
		$urls = array();
19
		$urls = array();
20
		foreach ($infosImages['resultats'] as $img) {
20
		foreach ($infosImages['resultats'] as $img) {
21
			$id = $img['determination.nom_sci.code'];
21
			$id = $img['determination.nom_sci.code'];
22
			$urls[$id][] = $img['binaire.href'];
22
			$urls[$id][] = $img['binaire.href'];
23
		}
23
		}
24
		return $urls;
24
		return $urls;
25
	}
25
	}
26
 
26
 
27
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
27
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
28
		$url = $this->getUrlImagesParIdsNoms($idsNoms);
28
		$url = $this->getUrlImagesParIdsNoms($idsNoms);
29
		return $this->chargerDonnees($url);
29
		return $this->chargerDonnees($url);
30
	}
30
	}
31
 
31
 
32
	private function getUrlImagesParIdsNoms($idsNoms) {
32
	private function getUrlImagesParIdsNoms($idsNoms) {
33
		$tpl = Config::get('imagesResultatsDeterminationTpl');
33
		$tpl = Config::get('imagesResultatsDeterminationTpl');
34
		$params = array('idsNoms' => implode(',', $idsNoms));
34
		$params = array('idsNoms' => implode(',', $idsNoms));
35
		$url = $this->formaterUrl($tpl, $params);
35
		$url = $this->formaterUrl($tpl, $params);
36
		return $url;
36
		return $url;
37
	}
37
	}
38
}
38
}
39
?>
39
?>