| 238 |
delphine |
1 |
<?php
|
|
|
2 |
// declare(encoding='UTF-8');
|
|
|
3 |
/**
|
|
|
4 |
* Classe mère du module Liste.
|
|
|
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 Illustrations extends aControleur {
|
| 291 |
jpm |
16 |
|
|
|
17 |
private $conteneur = null;
|
| 294 |
delphine |
18 |
private $nomCourant = null;
|
| 291 |
jpm |
19 |
private $images = null;
|
|
|
20 |
|
|
|
21 |
public function __construct(Conteneur $conteneur) {
|
|
|
22 |
$this->conteneur = $conteneur;
|
| 294 |
delphine |
23 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
| 291 |
jpm |
24 |
$this->images = $this->conteneur->getApiImages();
|
|
|
25 |
$this->appUrls = $this->conteneur->getAppUrls();
|
| 320 |
aurelien |
26 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
| 238 |
delphine |
27 |
}
|
| 291 |
jpm |
28 |
|
|
|
29 |
public function obtenirDonnees() {
|
|
|
30 |
$donnees = array();
|
|
|
31 |
$donnees['cel'] = $this->getCel();
|
| 339 |
aurelien |
32 |
$donnees['photoflora'] = $this->getPhotoFlora();
|
| 272 |
delphine |
33 |
return $donnees;
|
| 238 |
delphine |
34 |
}
|
| 291 |
jpm |
35 |
|
|
|
36 |
public function getBloc() {
|
|
|
37 |
// Trop long, il faut un service spécial...
|
|
|
38 |
$this->images->setProjet('cel');
|
| 294 |
delphine |
39 |
$nns = $this->nomCourant->getNns();
|
| 413 |
delphine |
40 |
$url = $this->images->getUrlPremiereImageParIdsNoms(array($nns));
|
|
|
41 |
$donnees['imageUrl'] = $url;
|
| 291 |
jpm |
42 |
return $donnees;
|
|
|
43 |
}
|
| 339 |
aurelien |
44 |
|
|
|
45 |
public function getPhotoFlora() {
|
|
|
46 |
$photoflora = array();
|
|
|
47 |
$this->images->setProjet('photoflora');
|
| 341 |
aurelien |
48 |
$nns = $this->nomCourant->getNns();
|
|
|
49 |
$images = $this->images->getInfosImagesParIdsNoms(array($nns));
|
| 339 |
aurelien |
50 |
|
|
|
51 |
$this->meta->setProjet('photoflora');
|
|
|
52 |
$meta = $this->meta->getMetaDonnees();
|
|
|
53 |
$titreMeta = $meta[0]['titre'];
|
|
|
54 |
$photoflora['images'] = $images['resultats'];
|
|
|
55 |
$photoflora['meta']['titre'] = $titreMeta;
|
|
|
56 |
$photoflora['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('photoflora');
|
|
|
57 |
return $photoflora;
|
|
|
58 |
}
|
| 291 |
jpm |
59 |
|
|
|
60 |
public function getCel() {
|
|
|
61 |
$cel = array();
|
|
|
62 |
$this->images->setProjet('cel');
|
| 294 |
delphine |
63 |
$nns = $this->nomCourant->getNns();
|
| 317 |
aurelien |
64 |
$images = $this->images->getInfosImagesParIdsNoms(array($nns));
|
| 320 |
aurelien |
65 |
|
|
|
66 |
$this->meta->setProjet('cel');
|
|
|
67 |
$meta = $this->meta->getMetaDonnees();
|
|
|
68 |
$titreMeta = $meta[0]['titre'];
|
| 317 |
aurelien |
69 |
$cel['images'] = $images['resultats'];
|
| 320 |
aurelien |
70 |
$cel['meta']['titre'] = $titreMeta;
|
| 291 |
jpm |
71 |
$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
|
|
|
72 |
return $cel;
|
|
|
73 |
}
|
| 238 |
delphine |
74 |
}
|
|
|
75 |
?>
|