Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 1381 Rev 1382
Line 98... Line 98...
98
		$donnees = array('cel' => array('images' => $this->donnees['cel']['images'], 'meta' => $this->donnees['cel']['meta'] ));
98
		$donnees = array('cel' => array('images' => $this->donnees['cel']['images'], 'meta' => $this->donnees['cel']['meta'] ));
99
		$html_tpl = $this->getVue($chemin_sous_squelette.'fiche_illustrations_cel.tpl.html', $donnees);
99
		$html_tpl = $this->getVue($chemin_sous_squelette.'fiche_illustrations_cel.tpl.html', $donnees);
100
		return $html_tpl;
100
		return $html_tpl;
101
	}
101
	}
Line -... Line 102...
-
 
102
	
-
 
103
	//TODO: factoriser les deux fonctions ci dessous et ci dessus
-
 
104
	public function obtenirTranchesCelTpl($projet) {
-
 
105
		// On ne prend que la tranche des images (10)
-
 
106
		$images = $this->initialiserTranchePhotos($projet);
-
 
107
		$this->formaterListePhotos($projet, $images);
-
 
108
		$this->formaterMetaPhotos($projet);
-
 
109
		$chemin_sous_squelette = Config::get('chemin_modules').AppControleur::getNomDossierDepuisClasse('Fiche').DS.Config::get('dossier_squelettes').DS;
-
 
110
		$donnees = array('cel' => array('images' => $this->donnees['cel']['images'], 'meta' => $this->donnees[$projet]['meta'] ));
-
 
111
		$html_tpl = $this->getVue($chemin_sous_squelette.'fiche_illustrations_cel.tpl.html', $donnees);
-
 
112
		$this->donnees[$projet]['illustrationsCel'] = $html_tpl;
-
 
113
		// Ensuite on fait juste un lien qui permettra de les charger
-
 
114
		$this->donnees[$projet]['ajax_url'] = $this->formaterUrlAjaxPhotoCel();
-
 
115
	}
102
	
116
	
103
	public function getPhoto($source) {
117
	public function getPhoto($source) {
104
		$donnees = array();
118
		$donnees = array();
105
		$this->images->setProjet($source);
119
		$this->images->setProjet($source);
106
		$nnr = $this->nomCourant->getNnr();
120
		$nnr = $this->nomCourant->getNnr();
Line 150... Line 164...
150
	public function getPhotos() {
164
	public function getPhotos() {
151
		$projets[] = Config::get($this->referentiel.'.baseImages');
165
		$projets[] = Config::get($this->referentiel.'.baseImages');
152
		$projets[] = Config::get($this->referentiel.'.baseImagesSupp');
166
		$projets[] = Config::get($this->referentiel.'.baseImagesSupp');
153
		foreach ($projets as $projet) {
167
		foreach ($projets as $projet) {
154
			if ($projet != "") {
168
			if ($projet != "") {
155
				// Beaucoup trop d'images pour cel, on fait juste un lien qui permettra de les charger
-
 
156
				if ($projet == "cel") {
169
				if ($projet == "cel") {
157
					$this->donnees['cel']['ajax_url'] = $this->formaterUrlAjaxPhotoCel();
170
					// Chargement des 10 premieres images + un lien pour en afficher plus
-
 
171
					$this->obtenirTranchesCelTpl($projet);
158
				} else {
172
				} else {
159
					$this->images->setApi(Eflore::API_EFLORE);
173
					$this->images->setApi(Eflore::API_EFLORE);
160
					$images = $this->initialiserPhotos($projet);
174
					$images = $this->initialiserPhotos($projet);
161
					$this->formaterListePhotos($projet, $images);
175
					$this->formaterListePhotos($projet, $images);
162
					$this->formaterMetaPhotos($projet);
176
					$this->formaterMetaPhotos($projet);
Line 254... Line 268...
254
		$this->images->setProjet($projet);
268
		$this->images->setProjet($projet);
255
		$nnr = $this->nomCourant->getNnr();
269
		$nnr = $this->nomCourant->getNnr();
256
		$ret = $this->images->getInfosImagesParIdsNoms(array($nnr));
270
		$ret = $this->images->getInfosImagesParIdsNoms(array($nnr));
257
		return $ret;
271
		return $ret;
258
	}
272
	}
-
 
273
	
-
 
274
	private function initialiserTranchePhotos($projet) {
-
 
275
		$this->images->setProjet($projet);
-
 
276
		$nnr = $this->nomCourant->getNnr();
-
 
277
		$ret = $this->images->getInfosTrancheImagesParIdsNoms(array($nnr));
-
 
278
		return $ret;
-
 
279
	}
Line 259... Line 280...
259
	
280
	
260
	private function formaterListePhotos($projet, $images) {
281
	private function formaterListePhotos($projet, $images) {
261
		foreach ($images as $idImg => $img) {
282
		foreach ($images as $idImg => $img) {
262
			$infosImg = array();
283
			$infosImg = array();