Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

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