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 Classification extends aControleur {
|
333 |
aurelien |
16 |
|
|
|
17 |
private $conteneur = null;
|
|
|
18 |
private $nomCourant = null;
|
|
|
19 |
private $taxons = null;
|
|
|
20 |
|
|
|
21 |
public function __construct(Conteneur $conteneur) {
|
|
|
22 |
$this->conteneur = $conteneur;
|
|
|
23 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
|
|
24 |
$this->taxons = $this->conteneur->getApiTaxons();
|
|
|
25 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
|
|
26 |
$this->appUrls = $this->conteneur->getAppUrls();
|
|
|
27 |
}
|
337 |
aurelien |
28 |
|
|
|
29 |
public function getBloc() {
|
385 |
delphine |
30 |
$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
|
337 |
aurelien |
31 |
$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
|
|
|
32 |
|
385 |
delphine |
33 |
$donnees['taxons_sup'] = is_array($donnees['taxons_sup']) ? array_slice($donnees['taxons_sup'], -3 , 3) : array();
|
340 |
aurelien |
34 |
$donnees['taxons_inf'] = is_array($donnees['taxons_inf']) ? array_slice($donnees['taxons_inf'], 0 , 3) : array();
|
337 |
aurelien |
35 |
|
|
|
36 |
return $donnees;
|
|
|
37 |
}
|
333 |
aurelien |
38 |
|
|
|
39 |
public function obtenirDonnees() {
|
379 |
delphine |
40 |
$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
|
468 |
delphine |
41 |
$donnees['taxon_courant']['rang.libelle'] = $this->nomCourant->getNomRetenu()->get('rang.libelle');
|
|
|
42 |
$donnees['taxon_courant']['nom_sci'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
|
|
|
43 |
$donnees['taxon_courant']['num_nom'] = $this->nomCourant->getNomRetenu()->get('id');
|
333 |
aurelien |
44 |
$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
|
|
|
45 |
$this->meta->setProjet('bdtfx');
|
|
|
46 |
$meta = $this->meta->getMetaDonnees();
|
|
|
47 |
$titreMeta = $meta[0]['titre'];
|
|
|
48 |
$donnees['meta']['titre'] = $titreMeta;
|
|
|
49 |
$donnees['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
|
334 |
aurelien |
50 |
$donnees['urls'] = $this->appUrls;
|
333 |
aurelien |
51 |
|
272 |
delphine |
52 |
return $donnees;
|
|
|
53 |
}
|
333 |
aurelien |
54 |
|
|
|
55 |
private function getTaxonsInferieurs() {
|
|
|
56 |
$num_nom = $this->nomCourant->getNomRetenu()->get('id');
|
|
|
57 |
$resultat = $this->taxons->getTaxonsInf($num_nom);
|
|
|
58 |
|
|
|
59 |
return $resultat[$num_nom];
|
|
|
60 |
}
|
|
|
61 |
|
272 |
delphine |
62 |
}
|
|
|
63 |
?>
|