272 |
delphine |
1 |
<?php
|
|
|
2 |
// declare(encoding='UTF-8');
|
|
|
3 |
/**
|
|
|
4 |
* Classe mère du module Liste.
|
|
|
5 |
*
|
|
|
6 |
* @category PHP 5.2
|
|
|
7 |
* @package eflore-consultation
|
|
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
9 |
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
|
|
|
10 |
* @copyright 2011 Tela-Botanica
|
|
|
11 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
|
|
|
12 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
|
|
|
13 |
* @version $Id$
|
|
|
14 |
*/
|
|
|
15 |
class Nomenclature extends aControleur {
|
291 |
jpm |
16 |
|
|
|
17 |
private $conteneur = null;
|
294 |
delphine |
18 |
private $nomCourant = null;
|
291 |
jpm |
19 |
private $noms = null;
|
|
|
20 |
private $meta = null;
|
|
|
21 |
|
|
|
22 |
public function __construct(Conteneur $conteneur) {
|
|
|
23 |
$this->conteneur = $conteneur;
|
294 |
delphine |
24 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
291 |
jpm |
25 |
$this->noms = $this->conteneur->getApiNoms();
|
326 |
aurelien |
26 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
291 |
jpm |
27 |
$this->appUrls = $this->conteneur->getAppUrls();
|
272 |
delphine |
28 |
}
|
291 |
jpm |
29 |
|
|
|
30 |
public function obtenirDonnees() {
|
370 |
aurelien |
31 |
|
291 |
jpm |
32 |
$donnees = array();
|
336 |
aurelien |
33 |
$donnees['flores_synonymes'] = $this->getFlores();
|
332 |
aurelien |
34 |
$donnees['synonymes']['noms'] = $this->getSynonymes();
|
373 |
aurelien |
35 |
$donnees['date_maj'] = $this->nomCourant->getNomRetenu()->get('maj_modif');
|
326 |
aurelien |
36 |
$meta = $this->meta->getMetaDonnees();
|
|
|
37 |
$titreMeta = $meta[0]['titre'];
|
|
|
38 |
$donnees['synonymes']['meta']['titre'] = $titreMeta;
|
|
|
39 |
$donnees['synonymes']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
|
332 |
aurelien |
40 |
$donnees['num_type'] = $this->nomCourant->getNomSelectionne()->get('num_type');
|
334 |
aurelien |
41 |
$donnees['urls'] = $this->appUrls;
|
378 |
delphine |
42 |
$donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet');
|
|
|
43 |
$donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet');
|
374 |
aurelien |
44 |
$donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci');
|
|
|
45 |
$donnees['nom_retenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
|
332 |
aurelien |
46 |
|
272 |
delphine |
47 |
return $donnees;
|
|
|
48 |
}
|
291 |
jpm |
49 |
|
|
|
50 |
public function getBloc() {
|
378 |
delphine |
51 |
$donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet');
|
|
|
52 |
$donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet');
|
291 |
jpm |
53 |
$synonymes = $this->getSynonymes();
|
372 |
aurelien |
54 |
$donnees['synonymes'] = array_slice($synonymes, 0, 3);
|
|
|
55 |
$donnees['autresSynonymesNbre'] = count($synonymes) - 3;
|
291 |
jpm |
56 |
return $donnees;
|
|
|
57 |
}
|
336 |
aurelien |
58 |
|
|
|
59 |
private function getFlores() {
|
|
|
60 |
$nns = $this->nomCourant->getNns();
|
|
|
61 |
$flores = $this->noms->getFlores($nns);
|
|
|
62 |
$flores['resultat'] = (isset($flores['resultat']) && is_array($flores['resultat'])) ? $flores['resultat'] : array();
|
|
|
63 |
return $flores['resultat'];
|
|
|
64 |
}
|
291 |
jpm |
65 |
|
|
|
66 |
private function getSynonymes() {
|
294 |
delphine |
67 |
$nns = $this->nomCourant->getNns();
|
291 |
jpm |
68 |
$synonymes = $this->noms->getSynonymes($nns);
|
332 |
aurelien |
69 |
$synonymes['resultat'] = (isset($synonymes['resultat']) && is_array($synonymes['resultat'])) ? $synonymes['resultat'] : array();
|
291 |
jpm |
70 |
return $synonymes['resultat'];
|
|
|
71 |
}
|
272 |
delphine |
72 |
}
|
|
|
73 |
?>
|