Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 1146 Rev 1156
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
	private $appUrls = null;
20
	private $appUrls = null;
21
	private $meta = null;
21
	private $meta = null;
22
	private $referentiel = 'bdtfx';
22
	private $referentiel = 'bdtfx';
23
	private $donnees = array();
23
	private $donnees = array();
24
 
24
 
25
	public function __construct(Conteneur $conteneur) {
25
	public function __construct(Conteneur $conteneur) {
26
		$this->conteneur = $conteneur;
26
		$this->conteneur = $conteneur;
27
		$this->nomCourant = $this->conteneur->getNomCourant();
27
		$this->nomCourant = $this->conteneur->getNomCourant();
28
		$this->referentiel = $this->conteneur->getParametre('referentiel');
28
		$this->referentiel = $this->conteneur->getParametre('referentiel');
29
		$this->images = $this->conteneur->getApiImages();
29
		$this->images = $this->conteneur->getApiImages();
30
		$this->appUrls = $this->conteneur->getAppUrls();
30
		$this->appUrls = $this->conteneur->getAppUrls();
31
		$this->meta = $this->conteneur->getApiMetaDonnees();
31
		$this->meta = $this->conteneur->getApiMetaDonnees();
32
	}
32
	}
33
 
33
 
34
	public function obtenirDonnees() {
34
	public function obtenirDonnees() {
35
		$this->donnees['nt'] = $this->nomCourant->getNt();
35
		$this->donnees['nt'] = $this->nomCourant->getNt();
36
		$this->donnees['nnr'] = $this->nomCourant->getNnr();
36
		$this->donnees['nnr'] = $this->nomCourant->getNnr();
37
		$this->donnees['nomSciRetenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html');
37
		$this->donnees['nomSciRetenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html');
38
		$infosNomRetenu = $this->nomCourant->getNomRetenu()->getInfos();
38
		$infosNomRetenu = $this->nomCourant->getNomRetenu()->getInfos();
39
		$this->donnees['nomComplet'] = $infosNomRetenu['nom_complet'];
39
		$this->donnees['nomComplet'] = $infosNomRetenu['nom_complet'];
40
		$this->getPhotos();
40
		$this->getPhotos();
41
		$this->getDessin();
41
		$this->getDessin();
42
		$this->getPhotosOrganes();
42
		//$this->getPhotosOrganes();
43
		$this->getPhotosCaracteresIdentification();
43
		$this->getPhotosCaracteresIdentification();
44
		$pso = $this->getPhotosSixOrganes();
44
		$pso = $this->getPhotosSixOrganes();
-
 
45
		// reconstruction de getPhotosOrganes à partir des données de getPhotosSixOrganes
-
 
46
		$this->donnees['organes'] = array();
-
 
47
		foreach ($pso as $organe => $images) {
-
 
48
			$clefs = array_keys($images);
-
 
49
			$image = $images[$clefs[0]];
-
 
50
			// changement de format - en dur, cracra !
-
 
51
			$image['binaire.href'] = str_replace('CRX2S', 'CRS', $image['binaire.href']);
-
 
52
			$this->donnees['organes'][$organe] = $image;
-
 
53
		}
-
 
54
		// --
45
		$this->setCheminSquelette('modules/fiche/squelettes/'); // @FIXME le chemin devrait déjà être défini correctement !?
55
		$this->setCheminSquelette('modules/fiche/squelettes/'); // @FIXME le chemin devrait déjà être défini correctement !?
46
		$this->donnees['illustrationsOrganes'] = $this->getVue('fiche_illustrations_organes',
56
		$this->donnees['illustrationsOrganes'] = $this->getVue('fiche_illustrations_organes',
47
				array('organes' => $pso, 'nnr' => $this->donnees['nnr'], 'nomComplet' => $this->donnees['nomComplet']));
57
				array('organes' => $pso, 'nnr' => $this->donnees['nnr'], 'nomComplet' => $this->donnees['nomComplet']));
48
		// chemins
58
		// chemins
49
		$this->donnees['base_url_widget'] = Config::get('base_url_widget');
59
		$this->donnees['base_url_widget'] = Config::get('base_url_widget');
50
		$this->donnees['base_url_del'] = Config::get('base_url_del');
60
		$this->donnees['base_url_del'] = Config::get('base_url_del');
51
		return $this->donnees;
61
		return $this->donnees;
52
	}
62
	}
53
	
63
	
54
	public function obtenirDonneesExport() {
64
	public function obtenirDonneesExport() {
55
		$this->donnees['nt'] = $this->nomCourant->getNt();
65
		$this->donnees['nt'] = $this->nomCourant->getNt();
56
		$this->donnees['nomSciRetenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html');
66
		$this->donnees['nomSciRetenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html');
57
		$this->donnees['cel'] = $this->getCelExport();
67
		$this->donnees['cel'] = $this->getCelExport();
58
		$this->donnees['coste'] = $this->getCoste();
68
		$this->donnees['coste'] = $this->getCoste();
59
		return $this->donnees;
69
		return $this->donnees;
60
	}
70
	}
61
 
71
 
62
	public function getBloc() {
72
	public function getBloc() {
63
		$this->donnees = $this->images->getInfosMeilleureImageParPrioriteTags($nnr = $this->nomCourant->getNnr(), array(
73
		$this->donnees = $this->images->getInfosMeilleureImageParPrioriteTags($nnr = $this->nomCourant->getNnr(), array(
64
				'fleur', 'feuille', 'fruit', 'ecorce', 'port', 'rameau'));
74
				'fleur', 'feuille', 'fruit', 'ecorce', 'port', 'rameau'));
65
		if (empty($this->donnees)) {
75
		if (empty($this->donnees)) {
66
			$this->donnees = $this->getPhoto('cel');
76
			$this->donnees = $this->getPhoto('cel');
67
			if (empty($this->donnees)) {
77
			if (empty($this->donnees)) {
68
				$infos_image = $this->getDessin();
78
				$infos_image = $this->getDessin();
69
				if (empty($infos_image) == false ) {
79
				if (empty($infos_image) == false ) {
70
					$this->donnees['imageUrl'] =  array_shift($infos_image['images']);
80
					$this->donnees['imageUrl'] =  array_shift($infos_image['images']);
71
				}
81
				}
72
			}
82
			}
73
		} else {
83
		} else {
74
			// extraction de l'url
84
			// extraction de l'url
75
			$this->donnees = array('imageUrl' => $this->donnees['binaire.href']);
85
			$this->donnees = array('imageUrl' => $this->donnees['binaire.href']);
76
		}
86
		}
77
		if (empty($this->donnees)) {
87
		if (empty($this->donnees)) {
78
			$this->donnees = $this->getPhoto('photoflora');
88
			$this->donnees = $this->getPhoto('photoflora');
79
		}
89
		}
80
		return $this->donnees;
90
		return $this->donnees;
81
	}
91
	}
82
	
92
	
83
	
93
	
84
	public function getPhoto($source) {
94
	public function getPhoto($source) {
85
		$donnees = array();
95
		$donnees = array();
86
		$this->images->setProjet($source);
96
		$this->images->setProjet($source);
87
		$nnr = $this->nomCourant->getNnr();
97
		$nnr = $this->nomCourant->getNnr();
88
		$infos_image = $this->images->setApi(Eflore::API_EFLORE)->getInfosPremiereImageParIdsNoms(array($nnr));
98
		$infos_image = $this->images->setApi(Eflore::API_EFLORE)->getInfosPremiereImageParIdsNoms(array($nnr));
89
		if ($infos_image != array()) {
99
		if ($infos_image != array()) {
90
			$image = array_shift($infos_image);
100
			$image = array_shift($infos_image);
91
			$donnees['imageUrl'] =  $image['binaire.href'];
101
			$donnees['imageUrl'] =  $image['binaire.href'];
92
		}
102
		}
93
		return $donnees;
103
		return $donnees;
94
	}
104
	}
95
 
105
 
96
	public function getCoste() {
106
	public function getCoste() {
97
		$coste = array();
107
		$coste = array();
98
		$tax = $this->nomCourant->getNomRetenu()->get('num_taxonomique');
108
		$tax = $this->nomCourant->getNomRetenu()->get('num_taxonomique');
99
		$this->images->setProjet('coste');
109
		$this->images->setProjet('coste');
100
		$this->images->setNnTaxon($tax);
110
		$this->images->setNnTaxon($tax);
101
		$costeImg = $this->images->setApi(Eflore::API_EFLORE)->getInfosImagesTaxons();
111
		$costeImg = $this->images->setApi(Eflore::API_EFLORE)->getInfosImagesTaxons();
102
		foreach ($costeImg as $infos) {
112
		foreach ($costeImg as $infos) {
103
			$coste['images'][] = $infos['binaire.href'];
113
			$coste['images'][] = $infos['binaire.href'];
104
		}
114
		}
105
		$this->meta->setProjet('coste');
115
		$this->meta->setProjet('coste');
106
		$meta = $this->meta->getMetaDonnees();
116
		$meta = $this->meta->getMetaDonnees();
107
		$coste['meta'] = $meta[0];
117
		$coste['meta'] = $meta[0];
108
		$coste['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('coste');
118
		$coste['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('coste');
109
		return $coste;
119
		return $coste;
110
	}
120
	}
111
 
121
 
112
	public function getDessin() {
122
	public function getDessin() {
113
		$projet = Config::get($this->referentiel.'.baseDessins');
123
		$projet = Config::get($this->referentiel.'.baseDessins');
114
		if ($projet != "") {
124
		if ($projet != "") {
115
			$dessin = array();
125
			$dessin = array();
116
			$tax = $this->nomCourant->getNomRetenu()->get('num_taxonomique');
126
			$tax = $this->nomCourant->getNomRetenu()->get('num_taxonomique');
117
			$this->images->setProjet($projet);
127
			$this->images->setProjet($projet);
118
			$this->images->setNnTaxon($tax);
128
			$this->images->setNnTaxon($tax);
119
			$costeImg = $this->images->setApi(Eflore::API_EFLORE)->getInfosImagesTaxons();
129
			$costeImg = $this->images->setApi(Eflore::API_EFLORE)->getInfosImagesTaxons();
120
				foreach ($costeImg as $infos) {
130
				foreach ($costeImg as $infos) {
121
					$dessin['images'][] = $infos['binaire.href'];
131
					$dessin['images'][] = $infos['binaire.href'];
122
				}
132
				}
123
			$this->meta->setProjet('coste');
133
			$this->meta->setProjet('coste');
124
			$meta = $this->meta->getMetaDonnees();
134
			$meta = $this->meta->getMetaDonnees();
125
			$dessin['meta'] = $meta[0];
135
			$dessin['meta'] = $meta[0];
126
			$dessin['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
136
			$dessin['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
127
			$this->donnees['coste'] = $dessin;
137
			$this->donnees['coste'] = $dessin;
128
		}
138
		}
129
	}
139
	}
130
	
140
	
131
	public function getPhotos() {
141
	public function getPhotos() {
132
		$projets[] = Config::get($this->referentiel.'.baseImages');
142
		$projets[] = Config::get($this->referentiel.'.baseImages');
133
		$projets[] = Config::get($this->referentiel.'.baseImagesSupp');
143
		$projets[] = Config::get($this->referentiel.'.baseImagesSupp');
134
		foreach ($projets as $projet) {
144
		foreach ($projets as $projet) {
135
			if ($projet != "") {
145
			if ($projet != "") {
136
				if ($projet == "cel") {
146
				if ($projet == "cel") {
137
					$this->images->setApi(Eflore::API_EFLORE); // prêt à passer à API_DEL
147
					$this->images->setApi(Eflore::API_EFLORE); // prêt à passer à API_DEL
138
				} else {
148
				} else {
139
					$this->images->setApi(Eflore::API_EFLORE);
149
					$this->images->setApi(Eflore::API_EFLORE);
140
				}
150
				}
141
				$images = $this->initialiserPhotos($projet);
151
				$images = $this->initialiserPhotos($projet);
142
				$this->formaterListePhotos($projet, $images);
152
				$this->formaterListePhotos($projet, $images);
143
				$this->formaterMetaPhotos($projet);
153
				$this->formaterMetaPhotos($projet);
144
			}
154
			}
145
		}
155
		}
146
	}
156
	}
147
	
157
	
148
	public function getPhotosSixOrganes() {
158
	public function getPhotosSixOrganes() {
149
		$organes = array(
159
		$organes = array(
150
				'fleur' => array(),
160
				'fleur' => array(),
151
				'feuille' => array(),
161
				'feuille' => array(),
152
				'fruit' => array(),
162
				'fruit' => array(),
153
				'ecorce' => array(),
163
				'ecorce' => array(),
154
				'port' => array(),
164
				'port' => array(),
155
				'rameau' => array());
165
				'rameau' => array());
156
		$nnr = $this->nomCourant->getNnr();
166
		$nnr = $this->nomCourant->getNnr();
157
		$infosOrganes = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CAPITALISATION, 6, 'CRX2S');
167
		$infosOrganes = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CAPITALISATION, 6, 'CRX2S');
158
		$vide = true;
168
		$vide = true;
159
		foreach ($infosOrganes as $tag => $organe) {
169
		foreach ($infosOrganes as $tag => $organe) {
160
			$organes[$tag] = $organe;
170
			$organes[$tag] = $organe;
161
			$nbImages = count($organe);
171
			$nbImages = count($organe);
162
			if ($nbImages != 0) {
172
			if ($nbImages != 0) {
163
				$vide = false;
173
				$vide = false;
164
				for ($i = 6; $i > $nbImages; $i--) {
174
				for ($i = 6; $i > $nbImages; $i--) {
165
					$organes[$tag][] = null;
175
					$organes[$tag][] = null;
166
				}
176
				}
167
			}
177
			}
168
		}
178
		}
169
		if ($vide) {
179
		if ($vide) {
170
			$organes = array();
180
			$organes = array();
171
		}
181
		}
172
		return $organes;
182
		return $organes;
173
	}
183
	}
174
	
184
	
175
	public function getPhotosOrganes() {
185
	public function getPhotosOrganes() {
176
		$organes = array(
186
		$organes = array(
177
				'fleur' => array(),
187
				'fleur' => array(),
178
				'feuille' => array(),
188
				'feuille' => array(),
179
				'fruit' => array(),
189
				'fruit' => array(),
180
				'ecorce' => array(),
190
				'ecorce' => array(),
181
				'port' => array(),
191
				'port' => array(),
182
				'rameau' => array());
192
				'rameau' => array());
183
		$nnr = $this->nomCourant->getNnr();
193
		$nnr = $this->nomCourant->getNnr();
184
		$infosOrganes = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CAPITALISATION, 1);
194
		$infosOrganes = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CAPITALISATION, 1);
185
		$vide = true;
195
		$vide = true;
186
		foreach ($infosOrganes as $tag => $organe) {
196
		foreach ($infosOrganes as $tag => $organe) {
187
			$nbImages = count($organe);
197
			$nbImages = count($organe);
188
			// une image par organe seulement
198
			// une image par organe seulement
189
			$organes[$tag] = array_pop($organe);
199
			$organes[$tag] = array_pop($organe);
190
			if ($nbImages != 0) {
200
			if ($nbImages != 0) {
191
				$vide = false;
201
				$vide = false;
192
			}
202
			}
193
		}
203
		}
194
		if ($vide) {
204
		if ($vide) {
195
			$organes = array();
205
			$organes = array();
196
		}
206
		}
197
		$this->donnees['organes'] = $organes;
207
		$this->donnees['organes'] = $organes;
198
	}
208
	}
199
	
209
	
200
	public function getPhotosCaracteresIdentification() {
210
	public function getPhotosCaracteresIdentification() {
201
		$caracteres = array();
211
		$caracteres = array();
202
		$nnr = $this->nomCourant->getNnr();
212
		$nnr = $this->nomCourant->getNnr();
203
		$infosCaracteres = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CARACTERES, 3);
213
		$infosCaracteres = $this->images->getInfosMeilleuresImagesParTag($nnr, array_keys($organes), Eflore::PROTOCOLE_CARACTERES, 3);
204
		if (! empty($infosCaracteres) && ! empty($infosCaracteres[''])) { // le tag est vide, ici
214
		if (! empty($infosCaracteres) && ! empty($infosCaracteres[''])) { // le tag est vide, ici
205
			$caracteres = $infosCaracteres[''];
215
			$caracteres = $infosCaracteres[''];
206
		}
216
		}
207
		$this->donnees['caracteres'] = $caracteres;
217
		$this->donnees['caracteres'] = $caracteres;
208
	}
218
	}
209
 
219
 
210
	// XXX: webservice:
220
	// XXX: webservice:
211
	// /service:eflore:0.1/cel/images?masque.nn=XXX&referentiel=bdtfx&retour.format=CS&navigation.limite=801
221
	// /service:eflore:0.1/cel/images?masque.nn=XXX&referentiel=bdtfx&retour.format=CS&navigation.limite=801
212
	private function initialiserPhotos($projet) {
222
	private function initialiserPhotos($projet) {
213
		$this->images->setProjet($projet);
223
		$this->images->setProjet($projet);
214
		$nnr = $this->nomCourant->getNnr();
224
		$nnr = $this->nomCourant->getNnr();
215
		$ret = $this->images->getInfosImagesParIdsNoms(array($nnr));
225
		$ret = $this->images->getInfosImagesParIdsNoms(array($nnr));
216
		return $ret;
226
		return $ret;
217
	}
227
	}
218
	
228
	
219
	private function formaterListePhotos($projet, $images) {
229
	private function formaterListePhotos($projet, $images) {
220
		foreach ($images as $idImg => $img) {
230
		foreach ($images as $idImg => $img) {
221
			$infosImg = array();
231
			$infosImg = array();
222
			$infosImg['src'] = $img['binaire.href'];
232
			$infosImg['src'] = $img['binaire.href'];
223
			$infosImg['nomSci'] = $img['determination.nom_sci'];
233
			$infosImg['nomSci'] = $img['determination.nom_sci'];
224
			$infosImg['station'] = $img['station.libelle'];
234
			$infosImg['station'] = $img['station.libelle'];
225
			$infosImg['date'] = $this->formaterDateImg($img['date']);
235
			$infosImg['date'] = $this->formaterDateImg($img['date']);
226
			$infosImg['auteur'] = $img['auteur.libelle'];
236
			$infosImg['auteur'] = $img['auteur.libelle'];
227
			$infosImg['auteur.id'] = $img['auteur.id'];
237
			$infosImg['auteur.id'] = $img['auteur.id'];
228
			if ($projet == "cel") {
238
			if ($projet == "cel") {
229
				$infosImg['urlDetailImg'] = $this->appUrls->obtenirUrlPopUpIllustrations($idImg);
239
				$infosImg['urlDetailImg'] = $this->appUrls->obtenirUrlPopUpIllustrations($idImg);
230
				$infosImg['urlContact'] = $this->appUrls->obtenirUrlPopUpContact($img['auteur.id'], $idImg);
240
				$infosImg['urlContact'] = $this->appUrls->obtenirUrlPopUpContact($img['auteur.id'], $idImg);
231
				$infosImg['urlProfil'] = $this->appUrls->obtenirUrlProfilAnnuaire($img['auteur.id']);
241
				$infosImg['urlProfil'] = $this->appUrls->obtenirUrlProfilAnnuaire($img['auteur.id']);
232
				$infosImg['urlMauvaiseIdentification'] =  $this->appUrls->obtenirUrlMauvaiseIdentification($img['observation.id']);
242
				$infosImg['urlMauvaiseIdentification'] =  $this->appUrls->obtenirUrlMauvaiseIdentification($img['observation.id']);
233
			}
243
			}
234
			$this->donnees[$projet]['images'][$idImg] = $infosImg;
244
			$this->donnees[$projet]['images'][$idImg] = $infosImg;
235
		}
245
		}
236
	}
246
	}
237
	
247
	
238
	private function formaterMetaPhotos($projet) {
248
	private function formaterMetaPhotos($projet) {
239
		$this->meta->setProjet($projet);
249
		$this->meta->setProjet($projet);
240
		$meta = $this->meta->getMetaDonnees();
250
		$meta = $this->meta->getMetaDonnees();
241
		$titreMeta = $meta[0];
251
		$titreMeta = $meta[0];
242
		$this->donnees[$projet]['meta'] = $titreMeta;
252
		$this->donnees[$projet]['meta'] = $titreMeta;
243
		$this->donnees[$projet]['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
253
		$this->donnees[$projet]['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
244
	}
254
	}
245
	
255
	
246
	
256
	
247
	
257
	
248
	public function getCelExport() {
258
	public function getCelExport() {
249
		$cel = array();
259
		$cel = array();
250
		$this->images->setProjet('cel');
260
		$this->images->setProjet('cel');
251
		$nnr = $this->nomCourant->getNnr();
261
		$nnr = $this->nomCourant->getNnr();
252
		$img = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
262
		$img = $this->images->getUrlPremiereImageParIdsNoms(array($nnr));
253
		if($img) {
263
		if($img) {
254
			$img = array_values($img);
264
			$img = array_values($img);
255
			$cel['images']['src'] = $img[0]['binaire.href'];
265
			$cel['images']['src'] = $img[0]['binaire.href'];
256
			$cel['images']['nomSci'] = $img[0]['determination.nom_sci'];
266
			$cel['images']['nomSci'] = $img[0]['determination.nom_sci'];
257
			$cel['images']['station'] = $img[0]['station.libelle'];
267
			$cel['images']['station'] = $img[0]['station.libelle'];
258
			$cel['images']['date'] = $this->formaterDateImg($img[0]['date']);
268
			$cel['images']['date'] = $this->formaterDateImg($img[0]['date']);
259
			$cel['images']['auteur'] = $img[0]['auteur.libelle'];
269
			$cel['images']['auteur'] = $img[0]['auteur.libelle'];
260
			$this->meta->setProjet('cel');
270
			$this->meta->setProjet('cel');
261
			$meta = $this->meta->getMetaDonnees();
271
			$meta = $this->meta->getMetaDonnees();
262
			$cel['meta'] = $meta[0];
272
			$cel['meta'] = $meta[0];
263
			$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
273
			$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
264
		}
274
		}
265
		return $cel;
275
		return $cel;
266
	}
276
	}
267
 
277
 
268
	private function formaterDateImg($date) {
278
	private function formaterDateImg($date) {
269
		$dateFmt = $date;
279
		$dateFmt = $date;
270
		if ($date == '' || $date == null || $date == '0000-00-00' || $date == '1970-01-01 01:01:01') {
280
		if ($date == '' || $date == null || $date == '0000-00-00' || $date == '1970-01-01 01:01:01') {
271
			return 'inconnue';
281
			return 'inconnue';
272
		}
282
		}
273
		$time = strtotime($date);
283
		$time = strtotime($date);
274
		if(!$time) {
284
		if(!$time) {
275
			/* TODO: php -r "echo strtotime('1891-00-00 00:00:00');"
285
			/* TODO: php -r "echo strtotime('1891-00-00 00:00:00');"
276
			   TODO: fixer le template pour affiche "en l'année X", plutôt que "le X"
286
			   TODO: fixer le template pour affiche "en l'année X", plutôt que "le X"
277
			   si FALSE pour avant 1901: problème php
287
			   si FALSE pour avant 1901: problème php
278
			   On retourne alors simplement l'année.
288
			   On retourne alors simplement l'année.
279
			   si correction, ne pas oublier modules/popup_illustrations/PopupIllustrations.php */
289
			   si correction, ne pas oublier modules/popup_illustrations/PopupIllustrations.php */
280
			$dateFmt = explode('-', $date);
290
			$dateFmt = explode('-', $date);
281
			return $dateFmt[0];
291
			return $dateFmt[0];
282
		}
292
		}
283
		return strftime('%e %B %Y', strtotime($date));
293
		return strftime('%e %B %Y', strtotime($date));
284
	}
294
	}
285
 
295
 
286
	private function formaterNomSci($nom) {
296
	private function formaterNomSci($nom) {
287
		$nomFmt = $nom;
297
		$nomFmt = $nom;
288
		if (is_null($nom) || $nom == '') {
298
		if (is_null($nom) || $nom == '') {
289
			$nomFmt = 'inconnu';
299
			$nomFmt = 'inconnu';
290
		}
300
		}
291
		return $nomFmt;
301
		return $nomFmt;
292
	}
302
	}
293
}
303
}
294
?>
304
?>