Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 310 Rev 313
Line 151... Line 151...
151
	private function formaterRetourJson($photographies) {	
151
	private function formaterRetourJson($photographies) {	
152
		$resultat = array();
152
		$resultat = array();
153
		foreach ($photographies as $photo) {
153
		foreach ($photographies as $photo) {
Line 154... Line 154...
154
 
154
 
-
 
155
			$image = array();
155
			$image = array();
156
			$url = $this->getUrlPhotoPourInitiales($photo['Initiales'], $photo['NumPhoto'], $this->format);
156
			$url = $this->getUrlPhotoPourInitiales($photo['Initiales'], $photo['NumPhoto']);
157
			$urlmax = $this->getUrlPhotoPourInitiales($photo['Initiales'], $photo['NumPhoto'], 'max');
157
			$id = str_replace(array('.jpg','.jpeg'),'',$photo['NumPhoto']);
158
			$id = str_replace(array('.jpg','.jpeg'),'',$photo['NumPhoto']);
158
			// Post-traitement des valeurs
159
			// Post-traitement des valeurs
159
			$image['station'] = $this->formaterChaineEncodeeBddPhotoflora($photo['lieu']);
160
			$image['station'] = $this->formaterChaineEncodeeBddPhotoflora($photo['lieu']);
160
			$image['date'] = $this->donnerDate($this->formaterChaineEncodeeBddPhotoflora($photo['Date']));
161
			$image['date'] = $this->donnerDate($this->formaterChaineEncodeeBddPhotoflora($photo['Date']));
161
			$image['auteur'] = $this->formaterChaineEncodeeBddPhotoflora($photo['Prenom'].' '.$photo['Nom']);
162
			$image['auteur'] = $this->formaterChaineEncodeeBddPhotoflora($photo['Prenom'].' '.$photo['Nom']);
162
			$image['determination'] = $photo['Combinaison'].' ['.$photo['Prenom'].' '.$photo['Nom'].']';
163
			$image['determination'] = $photo['Combinaison'].' ['.$photo['Prenom'].' '.$photo['Nom'].']';
163
			$image['determination.nom_sci'] = $photo['Combinaison'];
164
			$image['determination.nom_sci'] = $photo['Combinaison'];
164
			$image['determination.nom_sci.code'] = "bdtfx.".$photo['NumNomen'];
165
			$image['determination.nom_sci.code'] = "bdtfx.".$photo['NumNomen'];
-
 
166
			$image['binaire.href'] = $url;
Line 165... Line 167...
165
			$image['binaire.href'] = $url;
167
			$image['binaire.hrefmax'] = $urlmax;
166
			
168
			
Line 167... Line 169...
167
			$resultat[$id] = $image;
169
			$resultat[$id] = $image;
Line 184... Line 186...
184
		$xml .= '	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n";
186
		$xml .= '	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n";
185
		$xml .= '	xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
187
		$xml .= '	xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
186
		$xml .= '	xmlns:dcterms="http://purl.org/dc/terms">'."\n";
188
		$xml .= '	xmlns:dcterms="http://purl.org/dc/terms">'."\n";
187
		foreach ($photographies as $photo) {
189
		foreach ($photographies as $photo) {
Line 188... Line 190...
188
			
190
			
Line 189... Line 191...
189
			$url = $this->getUrlPhotoPourInitiales($photo['Initiales'], $photo['NumPhoto']);
191
			$url = $this->getUrlPhotoPourInitiales($photo['Initiales'], $photo['NumPhoto'], $this->format);
190
		
192
		
Line 191... Line 193...
191
			// Post-traitement des valeurs
193
			// Post-traitement des valeurs
Line 209... Line 211...
209
		$xml .= '</rdf:RDF>'."\n";
211
		$xml .= '</rdf:RDF>'."\n";
Line 210... Line 212...
210
		
212
		
211
		return $xml;
213
		return $xml;
Line 212... Line 214...
212
	}
214
	}
213
	
215
	
214
	private function getUrlPhotoPourInitiales($initiales, $num_photo) {
216
	private function getUrlPhotoPourInitiales($initiales, $num_photo, $format) {
215
		// Gestion des urls des photos
217
		// Gestion des urls des photos
216
		$url = '';
218
		$url = '';
217
		if ($initiales == 'bb') {
219
		if ($initiales == 'bb') {
218
			$base_url = ($this->format == 'max') ? $this->efph_url_photo_bb : $this->efph_url_photo_bb_min;
220
			$base_url = ($format == 'max') ? $this->efph_url_photo_bb : $this->efph_url_photo_bb_min;
219
			$url = sprintf($base_url, $num_photo);
221
			$url = sprintf($base_url, $num_photo);
220
		} else if ($initiales == 'jlt') {
222
		} else if ($initiales == 'jlt') {
221
			$base_url = ($this->format == 'max') ? $this->efph_url_photo_jlt : $this->efph_url_photo_jlt_min;
223
			$base_url = ($format == 'max') ? $this->efph_url_photo_jlt : $this->efph_url_photo_jlt_min;
222
			$url = sprintf($base_url, $num_photo);
224
			$url = sprintf($base_url, $num_photo);
223
		} else {
225
		} else {
224
			$base_url = ($this->format == 'max') ? $this->efph_url_photo : $this->efph_url_photo_min;
226
			$base_url = ($format == 'max') ? $this->efph_url_photo : $this->efph_url_photo_min;
Line 225... Line 227...
225
			$url = sprintf($base_url, $initiales, $num_photo);
227
			$url = sprintf($base_url, $initiales, $num_photo);
226
		}
228
		}