Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 321 | Rev 341 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
		/*
39
		$this->images->setProjet('cel');
294 delphine 40
		$nns = $this->nomCourant->getNns();
291 jpm 41
		$urls = $this->images->getUrlsImagesParIdsNoms(array($nns));
42
		$donnees['imageUrl'] = $urls["bdtfx.$nns"][0];
43
		*/
321 aurelien 44
		$donnees = array();
291 jpm 45
		return $donnees;
46
	}
339 aurelien 47
 
48
	public function getPhotoFlora() {
49
		$photoflora = array();
50
		$this->images->setProjet('photoflora');
51
 
52
		// pour le moment on triche et on envoie un num tax alors qu'on
53
		// utilise le paramètre masque.nn
54
		$nt = $this->nomCourant->getNomSelectionne()->get('num_tax');
55
		$images = $this->images->getInfosImagesParIdsNoms(array($nt));
56
 
57
		$this->meta->setProjet('photoflora');
58
		$meta = $this->meta->getMetaDonnees();
59
		$titreMeta = $meta[0]['titre'];
60
		$photoflora['images'] = $images['resultats'];
61
		$photoflora['meta']['titre'] = $titreMeta;
62
		$photoflora['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('photoflora');
63
		return $photoflora;
64
	}
291 jpm 65
 
66
	public function getCel() {
67
		$cel = array();
68
		$this->images->setProjet('cel');
294 delphine 69
		$nns = $this->nomCourant->getNns();
317 aurelien 70
		$images = $this->images->getInfosImagesParIdsNoms(array($nns));
320 aurelien 71
 
72
		$this->meta->setProjet('cel');
73
		$meta = $this->meta->getMetaDonnees();
74
		$titreMeta = $meta[0]['titre'];
317 aurelien 75
		$cel['images'] = $images['resultats'];
320 aurelien 76
		$cel['meta']['titre'] = $titreMeta;
291 jpm 77
		$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
78
		return $cel;
79
	}
238 delphine 80
}
81
?>