Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 434 Rev 448
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
		$donnees['photoflora'] = $this->getPhotoFlora();
33
		return $donnees;
33
		return $donnees;
34
	}
34
	}
35
 
35
 
36
	public function getBloc() {
36
	public function getBloc() {
37
		// Trop long, il faut un service spécial...
37
		// Trop long, il faut un service spécial...
38
		$this->images->setProjet('cel');
38
		$this->images->setProjet('cel');
39
		$nns = $this->nomCourant->getNns();
39
		$nnr = $this->nomCourant->getNnr();
40
		$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nns));
40
		$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
41
		$image = array_slice($infos_image['resultats'], 0);
41
		$image = array_slice($infos_image['resultats'], 0);
42
		$donnees['imageUrl'] = $image[0]['binaire.href'];
42
		$donnees['imageUrl'] = $image[0]['binaire.href'];
43
		return $donnees;
43
		return $donnees;
44
	}
44
	}
45
	
45
	
46
	public function getPhotoFlora() {
46
	public function getPhotoFlora() {
47
		$photoflora = array();
47
		$photoflora = array();
48
		$this->images->setProjet('photoflora');
48
		$this->images->setProjet('photoflora');
49
		$nns = $this->nomCourant->getNns();
49
		$nnr = $this->nomCourant->getNnr();
50
		$images = $this->images->getInfosImagesParIdsNoms(array($nns));
50
		$images = $this->images->getInfosImagesParIdsNoms(array($nnr));
51
		
51
		
52
		$this->meta->setProjet('photoflora');
52
		$this->meta->setProjet('photoflora');
53
		$meta = $this->meta->getMetaDonnees();
53
		$meta = $this->meta->getMetaDonnees();
54
		$titreMeta = $meta[0]['titre'];
54
		$titreMeta = $meta[0]['titre'];
55
		$photoflora['images'] = $images['resultats'];
55
		$photoflora['images'] = $images['resultats'];
56
		$photoflora['meta']['titre'] = $titreMeta;
56
		$photoflora['meta']['titre'] = $titreMeta;
57
		$photoflora['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('photoflora');
57
		$photoflora['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('photoflora');
58
		return $photoflora;
58
		return $photoflora;
59
	}
59
	}
60
 
60
 
61
	public function getCel() {
61
	public function getCel() {
62
		$cel = array();
62
		$cel = array();
63
		$this->images->setProjet('cel');
63
		$this->images->setProjet('cel');
64
		$nns = $this->nomCourant->getNns();
64
		$nnr = $this->nomCourant->getNnr();
65
		$images = $this->images->getInfosImagesParIdsNoms(array($nns));
65
		$images = $this->images->getInfosImagesParIdsNoms(array($nnr));
66
		
66
		
67
		$this->meta->setProjet('cel');
67
		$this->meta->setProjet('cel');
68
		$meta = $this->meta->getMetaDonnees();
68
		$meta = $this->meta->getMetaDonnees();
69
		$titreMeta = $meta[0]['titre'];
69
		$titreMeta = $meta[0]['titre'];
70
		$cel['images'] = $images['resultats'];
70
		$cel['images'] = $images['resultats'];
71
		$cel['meta']['titre'] = $titreMeta;
71
		$cel['meta']['titre'] = $titreMeta;
72
		$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
72
		$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
73
		return $cel;
73
		return $cel;
74
	}
74
	}
75
}
75
}
76
?>
76
?>