Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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;
20
	private $referentiel = null;
21
 
22
 
422 delphine 23
	public function __construct(Conteneur $conteneur) {
24
		$this->conteneur = $conteneur;
25
		$this->nomCourant = $this->conteneur->getNomCourant();
26
		$this->wikini = $this->conteneur->getApiWikini();
768 aurelien 27
		$this->statuts = $this->conteneur->getApiStatuts();
985 delphine 28
		$this->referentiel = $this->conteneur->getParametre('referentiel');
422 delphine 29
	}
30
 
768 aurelien 31
	public function getBloc() {
32
		$donnees = array();
33
		$donnees['statuts'] = $this->getStatutsZoneGeo();
34
		if(empty($statuts)) {
35
			$donnees['wikini'] = $this->getWikini();
36
		}
37
		return $donnees;
38
	}
39
 
422 delphine 40
	public function obtenirDonnees() {
417 aurelien 41
		$donnees = array();
42
		$donnees['wikini'] = $this->getWikini();
768 aurelien 43
		$donnees['statuts'] = $this->getStatuts();
272 delphine 44
		return $donnees;
45
	}
417 aurelien 46
 
768 aurelien 47
	private function getStatuts() {
985 delphine 48
		$statuts = "";
49
		$projet = Config::get($this->referentiel.'.baseStatuts');
50
		if ($projet != "") {
51
			$nnr = $this->nomCourant->getNnr();
52
			$statuts = $this->statuts->getStatuts($projet, $nnr);
53
		}
768 aurelien 54
		return $statuts;
55
	}
56
 
57
	private function getStatutsZoneGeo() {
985 delphine 58
		$statuts = "";
59
		$projet = Config::get($this->referentiel.'.baseStatuts');
60
		if ($projet != "") {
61
			$nnr = $this->nomCourant->getNnr();
62
			$statuts = $this->statuts->getStatutsZoneGeo($projet, $nnr);
63
		}
768 aurelien 64
		return $statuts;
65
	}
66
 
417 aurelien 67
	private function getWikini() {
68
		$wikini = array();
69
		$wikini['titre'] = 'Wikini';
70
		$referentiel = $this->conteneur->getParametre('referentiel');
71
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
72
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
418 aurelien 73
		$wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
417 aurelien 74
		return $wikini;
75
	}
272 delphine 76
}
77
?>