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