247,7 → 247,8 |
public function retournerResultatFormate($resultat) { |
$this->recupererTableConfig('correspondance_champs'); |
switch ($this->format_reponse) { |
case 'noms-vernaculaires' : $reponse = $this->formaterNomsVernaculaires($resultat); break; |
case 'noms-vernaculaires' : |
$reponse = ($this->retour_format == 'oss') ? $this->formaterEnOss($resultat) : $this->formaterNomsVernaculaires($resultat); break; |
case 'noms-vernaculaires/id' : $reponse = $this->formaterNomsVernaculairesId($resultat); break; |
case 'noms-vernaculaires/id/champ' : $reponse = $this->formaterNomsVernaculairesIdChamp($resultat); break; |
default : break; |
286,6 → 287,23 |
$table_retour_json['resultat'] = $resultat_json; |
return $table_retour_json; |
} |
|
public function formaterEnOss($resultat) { |
$table_nom = array(); |
$oss = ''; |
foreach ($resultat as $tab) { |
if (isset($tab['nom_vernaculaire']) ) { |
if (!in_array($tab['nom_vernaculaire'], $table_nom)) { |
$table_nom[] = $tab['nom_vernaculaire']; |
$oss [] = $tab['nom_vernaculaire']; |
} |
} |
} |
if (isset($this->masque)) $masque = implode('&', $this->masque); |
else $masque = 'Pas de masque'; |
$table_retour_oss = array($masque, $oss); |
return $table_retour_oss; |
} |
|
// formatage de la reponse /id ss la forme |
// id, nom_vernaculaire, attributions |