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 Statut extends aControleur {
|
985 |
delphine |
16 |
private $conteneur = null;
|
|
|
17 |
private $nomCourant = null;
|
|
|
18 |
private $wikini = null;
|
|
|
19 |
private $statuts = null;
|
1130 |
aurelien |
20 |
private $meta;
|
985 |
delphine |
21 |
private $referentiel = null;
|
1130 |
aurelien |
22 |
private $appUrls;
|
985 |
delphine |
23 |
|
422 |
delphine |
24 |
public function __construct(Conteneur $conteneur) {
|
|
|
25 |
$this->conteneur = $conteneur;
|
|
|
26 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
|
|
27 |
$this->wikini = $this->conteneur->getApiWikini();
|
768 |
aurelien |
28 |
$this->statuts = $this->conteneur->getApiStatuts();
|
1130 |
aurelien |
29 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
985 |
delphine |
30 |
$this->referentiel = $this->conteneur->getParametre('referentiel');
|
1130 |
aurelien |
31 |
$this->appUrls = $this->conteneur->getAppUrls();
|
422 |
delphine |
32 |
}
|
|
|
33 |
|
768 |
aurelien |
34 |
public function getBloc() {
|
|
|
35 |
$donnees = array();
|
|
|
36 |
$donnees['statuts'] = $this->getStatutsZoneGeo();
|
1139 |
aurelien |
37 |
if(empty($donnees['statuts'])) {
|
768 |
aurelien |
38 |
$donnees['wikini'] = $this->getWikini();
|
|
|
39 |
}
|
1139 |
aurelien |
40 |
$donnees['liste_rouge'] = $this->getCategorieListeRouge();
|
768 |
aurelien |
41 |
return $donnees;
|
|
|
42 |
}
|
|
|
43 |
|
422 |
delphine |
44 |
public function obtenirDonnees() {
|
417 |
aurelien |
45 |
$donnees = array();
|
|
|
46 |
$donnees['wikini'] = $this->getWikini();
|
768 |
aurelien |
47 |
$donnees['statuts'] = $this->getStatuts();
|
1139 |
aurelien |
48 |
$donnees['liste_rouge'] = $this->getCategorieListeRouge();
|
272 |
delphine |
49 |
return $donnees;
|
|
|
50 |
}
|
417 |
aurelien |
51 |
|
768 |
aurelien |
52 |
private function getStatuts() {
|
985 |
delphine |
53 |
$statuts = "";
|
|
|
54 |
$projet = Config::get($this->referentiel.'.baseStatuts');
|
|
|
55 |
if ($projet != "") {
|
|
|
56 |
$nnr = $this->nomCourant->getNnr();
|
|
|
57 |
$statuts = $this->statuts->getStatuts($projet, $nnr);
|
1130 |
aurelien |
58 |
$this->meta->setProjet($projet);
|
|
|
59 |
$meta = $this->meta->getMetaDonnees();
|
|
|
60 |
$statuts['meta'] = $meta[0];
|
|
|
61 |
$statuts['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
|
985 |
delphine |
62 |
}
|
768 |
aurelien |
63 |
return $statuts;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
private function getStatutsZoneGeo() {
|
985 |
delphine |
67 |
$statuts = "";
|
|
|
68 |
$projet = Config::get($this->referentiel.'.baseStatuts');
|
|
|
69 |
if ($projet != "") {
|
|
|
70 |
$nnr = $this->nomCourant->getNnr();
|
|
|
71 |
$statuts = $this->statuts->getStatutsZoneGeo($projet, $nnr);
|
1130 |
aurelien |
72 |
$this->meta->setProjet($projet);
|
|
|
73 |
$meta = $this->meta->getMetaDonnees();
|
|
|
74 |
$statuts['meta'] = $meta[0];
|
|
|
75 |
$statuts['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
|
985 |
delphine |
76 |
}
|
768 |
aurelien |
77 |
return $statuts;
|
|
|
78 |
}
|
|
|
79 |
|
1139 |
aurelien |
80 |
private function getCategorieListeRouge() {
|
|
|
81 |
$liste_rouge = "";
|
|
|
82 |
$projet = Config::get($this->referentiel.'.baseListeRouge');
|
|
|
83 |
if ($projet != "") {
|
|
|
84 |
$nnr = $this->nomCourant->getNnr();
|
|
|
85 |
$liste_rouge = $this->statuts->getCategorieListeRouge($projet, $nnr);
|
|
|
86 |
$this->meta->setProjet($projet);
|
|
|
87 |
$meta = $this->meta->getMetaDonnees();
|
|
|
88 |
$liste_rouge['meta'] = $meta[0];
|
|
|
89 |
$liste_rouge['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
|
|
|
90 |
}
|
|
|
91 |
return $liste_rouge;
|
|
|
92 |
}
|
|
|
93 |
|
417 |
aurelien |
94 |
private function getWikini() {
|
|
|
95 |
$wikini = array();
|
|
|
96 |
$wikini['titre'] = 'Wikini';
|
|
|
97 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
|
|
98 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
|
|
99 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
418 |
aurelien |
100 |
$wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
|
417 |
aurelien |
101 |
return $wikini;
|
|
|
102 |
}
|
272 |
delphine |
103 |
}
|
|
|
104 |
?>
|