Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 470 | Rev 482 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 470 Rev 478
Line 15... Line 15...
15
class Illustrations extends aControleur {
15
class Illustrations extends aControleur {
Line 16... Line 16...
16
 
16
 
17
	private $conteneur = null;
17
	private $conteneur = null;
18
	private $nomCourant = null;
18
	private $nomCourant = null;
-
 
19
	private $images = null;
-
 
20
	private $appUrls = null;
Line 19... Line 21...
19
	private $images = null;
21
	private $meta = null;
20
 
22
 
21
	public function __construct(Conteneur $conteneur) {
23
	public function __construct(Conteneur $conteneur) {
22
		$this->conteneur = $conteneur;
24
		$this->conteneur = $conteneur;
Line 32... Line 34...
32
		$donnees['photoflora'] = $this->getPhotoFlora();
34
		$donnees['photoflora'] = $this->getPhotoFlora();
33
		return $donnees;
35
		return $donnees;
34
	}
36
	}
Line 35... Line 37...
35
 
37
 
36
	public function getBloc() {
-
 
37
		// Trop long, il faut un service spécial...
38
	public function getBloc() {
38
		$this->images->setProjet('cel');
39
		$this->images->setProjet('cel');
39
		$nnr = $this->nomCourant->getNnr();
40
		$nnr = $this->nomCourant->getNnr();
40
		$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
41
		$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
41
		if(!$infos_image || $infos_image['entete']['total'] == 0) {
42
		if (!$infos_image || $infos_image['entete']['total'] == 0) {
42
			$this->images->setProjet('photoflora');
43
			$this->images->setProjet('photoflora');
43
			$nnr = $this->nomCourant->getNnr();
44
			$nnr = $this->nomCourant->getNnr();
44
			$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
45
			$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
45
		}
46
		}
46
		
47
 
47
		$image = array_shift($infos_image['resultats']);
48
		$image = array_shift($infos_image['resultats']);
48
		$donnees['imageUrl'] = $image['binaire.href'];
49
		$donnees['imageUrl'] = $image['binaire.href'];
49
		return $donnees;
50
		return $donnees;
50
	}
51
	}
51
	
52
 
52
	public function getPhotoFlora() {
53
	public function getPhotoFlora() {
53
		$photoflora = array();
54
		$photoflora = array();
54
		$this->images->setProjet('photoflora');
55
		$this->images->setProjet('photoflora');
55
		$nnr = $this->nomCourant->getNnr();
56
		$nnr = $this->nomCourant->getNnr();
-
 
57
		$images = $this->images->getInfosImagesParIdsNoms(array($nnr));
56
		$images = $this->images->getInfosImagesParIdsNoms(array($nnr));
58
		$photoflora['images'] = $images['resultats'];
57
		
59
 
58
		$this->meta->setProjet('photoflora');
60
		$this->meta->setProjet('photoflora');
59
		$meta = $this->meta->getMetaDonnees();
61
		$meta = $this->meta->getMetaDonnees();
60
		$titreMeta = $meta[0]['titre'];
-
 
61
		$photoflora['images'] = $images['resultats'];
62
		$titreMeta = $meta[0]['titre'];
62
		$photoflora['meta']['titre'] = $titreMeta;
63
		$photoflora['meta']['titre'] = $titreMeta;
-
 
64
		$photoflora['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('photoflora');
63
		$photoflora['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('photoflora');
65
 
64
		return $photoflora;
66
		return $photoflora;
Line 65... Line 67...
65
	}
67
	}
66
 
68
 
67
	public function getCel() {
69
	public function getCel() {
68
		$cel = array();
70
		$cel = array();
69
		$this->images->setProjet('cel');
71
		$this->images->setProjet('cel');
-
 
72
		$nnr = $this->nomCourant->getNnr();
-
 
73
		$images = $this->images->getInfosImagesParIdsNoms(array($nnr));
-
 
74
		foreach ($images['resultats'] as $idImg => $img) {
-
 
75
			$cel['images'][$idImg] = $img;
70
		$nnr = $this->nomCourant->getNnr();
76
			$cel['images'][$idImg]['url.pop-up'] = $this->appUrls->obtenirUrlPopUpIllustrations($idImg);
71
		$images = $this->images->getInfosImagesParIdsNoms(array($nnr));
77
		}
72
		
78
 
73
		$this->meta->setProjet('cel');
79
		$this->meta->setProjet('cel');
74
		$meta = $this->meta->getMetaDonnees();
-
 
75
		$titreMeta = $meta[0]['titre'];
80
		$meta = $this->meta->getMetaDonnees();
76
		$cel['images'] = $images['resultats'];
81
		$titreMeta = $meta[0]['titre'];
-
 
82
		$cel['meta']['titre'] = $titreMeta;
77
		$cel['meta']['titre'] = $titreMeta;
83
		$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
78
		$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
84
 
79
		return $cel;
85
		return $cel;
80
	}
86
	}
81
}
87
}