21,14 → 21,16 |
$donnees['type_nom'] = $this->type_nom; |
$donnees['nom'] = $this->nom; |
if (strlen($donnees['nom']) < 3) { |
$donnees['information'] = 'Veuillez saisir un radical contenant au moins 3 caractères alphabétiques !'; |
$donnees['message']['attention'] = 'info_nb_lettres'; |
} else { |
$presence = $this->rechercherNom(); |
if ($presence == '') { |
$donnees['information'] = 'Nom inconnu'; |
} elseif ($presence != 'ok') { |
$donnees['nom_approche'] = $presence; |
$donnees['url_nom_approche'] = $this->obtenirUrlRechercheSimple($presence, $donnees['type_nom']); |
if ($presence == '') { // s'il n'y a pas de nom |
$donnees['message']['attention'] = 'info_sp_abs'; |
} elseif ($presence != 'ok') { // s'il y a des noms approchés |
if (!Registre::get('resultats')) { // s'il n'y a aucun nom exact |
$donnees['message']['attention'] = 'info_sp_abs'; |
} |
$donnees['message']['nom_approche'] = $presence; |
} |
} |
Registre::set('donneesMoteur', $donnees); |
57,7 → 59,7 |
$res['type'] = $this->type_nom; |
Registre::set('resultats', $res); |
$approche = 'ok'; |
if ($res['entete']['total'] < 16) { // si moins de 16 noms affiche en plus un nom approché |
if ($res['entete']['total'] < 3) { // si moins de 16 noms affiche en plus un nom approché |
$approche = $this->rechercherNomApproche($noms); |
} |
} |
68,8 → 70,11 |
$approche = ''; |
$res = $noms->getRechercheFloue($this->nom); |
if (!($res == false || $res['entete']['total'] == 0)) { |
$nom_proche = array_shift($res['resultat']); |
$approche = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci']; |
for ($i = 0; $i < 3; $i++) { |
$nom_proche = array_shift($res['resultat']); |
$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci']; |
$approche[$i]['url_nom_approche'] = $this->obtenirUrlRechercheSimple($approche, $this->type_nom); |
} |
} |
return $approche; |
} |