130 |
jpm |
1 |
<?php
|
|
|
2 |
// declare(encoding='UTF-8');
|
|
|
3 |
/**
|
|
|
4 |
* Classe gérant les images.
|
|
|
5 |
*
|
|
|
6 |
* @category PHP 5.2
|
|
|
7 |
* @package eflore-consultation
|
|
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
9 |
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
|
|
|
10 |
* @copyright 2011 Tela-Botanica
|
|
|
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
|
|
|
13 |
* @version $Id$
|
|
|
14 |
*/
|
|
|
15 |
class Images extends Eflore {
|
317 |
aurelien |
16 |
|
339 |
aurelien |
17 |
//TODO: créer des fonctions spécifiques cel et photoflora pour plus de clarté ?
|
130 |
jpm |
18 |
public function getUrlsImagesParIdsNoms(Array $idsNoms) {
|
|
|
19 |
$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
|
|
|
20 |
$urls = array();
|
|
|
21 |
foreach ($infosImages['resultats'] as $img) {
|
|
|
22 |
$id = $img['determination.nom_sci.code'];
|
|
|
23 |
$urls[$id][] = $img['binaire.href'];
|
|
|
24 |
}
|
|
|
25 |
return $urls;
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
public function getInfosImagesParIdsNoms(Array $idsNoms) {
|
|
|
29 |
$url = $this->getUrlImagesParIdsNoms($idsNoms);
|
|
|
30 |
return $this->chargerDonnees($url);
|
|
|
31 |
}
|
475 |
delphine |
32 |
|
|
|
33 |
public function getInfosImageParIdImage($id_image) {
|
|
|
34 |
$tpl = Config::get('imagesPopupTpl');
|
476 |
delphine |
35 |
$url = $this->formaterUrl($tpl, array('id'=>$id_image));
|
475 |
delphine |
36 |
return $this->chargerDonnees($url);
|
|
|
37 |
}
|
130 |
jpm |
38 |
|
|
|
39 |
private function getUrlImagesParIdsNoms($idsNoms) {
|
|
|
40 |
$tpl = Config::get('imagesResultatsDeterminationTpl');
|
|
|
41 |
$params = array('idsNoms' => implode(',', $idsNoms));
|
|
|
42 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
43 |
return $url;
|
|
|
44 |
}
|
414 |
delphine |
45 |
|
|
|
46 |
public function getUrlPremiereImageParIdsNoms($idsNoms) {
|
|
|
47 |
$tpl = Config::get('imagesFicheBlocTpl');
|
|
|
48 |
$params = array('idsNoms' => implode(',', $idsNoms));
|
|
|
49 |
$url = $this->formaterUrl($tpl, $params);
|
433 |
delphine |
50 |
return $this->chargerDonnees($url);
|
414 |
delphine |
51 |
}
|
130 |
jpm |
52 |
}
|
|
|
53 |
?>
|