Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 109 Rev 132
Line 245... Line 245...
245
	// determine en fct du service appelé (/noms-vernaculaires | /noms-vernaculaires/#id | /noms-vernaculaires/#id/champ |
245
	// determine en fct du service appelé (/noms-vernaculaires | /noms-vernaculaires/#id | /noms-vernaculaires/#id/champ |
246
	// /noms-vernaculaires/#id/relations) le format du tableau à retourner.
246
	// /noms-vernaculaires/#id/relations) le format du tableau à retourner.
247
	public function retournerResultatFormate($resultat) {
247
	public function retournerResultatFormate($resultat) {
248
		$this->recupererTableConfig('correspondance_champs');
248
		$this->recupererTableConfig('correspondance_champs');
249
		switch ($this->format_reponse) {
249
		switch ($this->format_reponse) {
-
 
250
			case 'noms-vernaculaires'				: 
250
			case 'noms-vernaculaires'				: $reponse = $this->formaterNomsVernaculaires($resultat);			break;
251
				$reponse = ($this->retour_format == 'oss') ? $this->formaterEnOss($resultat) : $this->formaterNomsVernaculaires($resultat);			break;
251
			case 'noms-vernaculaires/id'			: $reponse = $this->formaterNomsVernaculairesId($resultat);			break;
252
			case 'noms-vernaculaires/id'			: $reponse = $this->formaterNomsVernaculairesId($resultat);			break;
252
			case 'noms-vernaculaires/id/champ'		: $reponse = $this->formaterNomsVernaculairesIdChamp($resultat);	break;
253
			case 'noms-vernaculaires/id/champ'		: $reponse = $this->formaterNomsVernaculairesIdChamp($resultat);	break;
253
			default									:																	break;
254
			default									:																	break;
254
		}
255
		}
255
		return $reponse;
256
		return $reponse;
Line 284... Line 285...
284
		}
285
		}
Line 285... Line 286...
285
 
286
 
286
		$table_retour_json['resultat'] = $resultat_json;
287
		$table_retour_json['resultat'] = $resultat_json;
287
		return $table_retour_json;
288
		return $table_retour_json;
-
 
289
	}
-
 
290
	
-
 
291
	public function formaterEnOss($resultat) {
-
 
292
		$table_nom = array();
-
 
293
		$oss = '';
-
 
294
		foreach ($resultat as $tab) {
-
 
295
			if (isset($tab['nom_vernaculaire']) ) {
-
 
296
				if (!in_array($tab['nom_vernaculaire'], $table_nom)) {
-
 
297
					$table_nom[] = $tab['nom_vernaculaire'];
-
 
298
					$oss [] = $tab['nom_vernaculaire'];
-
 
299
				}
-
 
300
			}
-
 
301
		}
-
 
302
		if (isset($this->masque)) $masque = implode('&', $this->masque);
-
 
303
		else $masque = 'Pas de masque';
-
 
304
		$table_retour_oss = array($masque, $oss);
-
 
305
		return $table_retour_oss;
Line 288... Line 306...
288
	}
306
	}
289
 
307
 
290
	// formatage de la reponse /id ss la forme
308
	// formatage de la reponse /id ss la forme
291
	// id, nom_vernaculaire, attributions
309
	// id, nom_vernaculaire, attributions