Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 985 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
// declare(encoding='UTF-8');
/**
 * Classe mère du module Liste.
 *
 * @category    PHP 5.2
 * @package             eflore-consultation
 * @author              Jean-Pascal MILCENT <jpm@tela-botanica.org>
 * @author              Delphine CAUQUIL <delphine@tela-botanica.org>
 * @copyright   2011 Tela-Botanica
 * @license             http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
 * @license             http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
 * @version             $Id$
 */
class Statut extends aControleur {
        private $conteneur = null;
        private $nomCourant = null;
        private $wikini = null;
        private $statuts = null;
        private $referentiel = null;
        
        
        public function __construct(Conteneur $conteneur) {
                $this->conteneur = $conteneur;
                $this->nomCourant = $this->conteneur->getNomCourant();
                $this->wikini = $this->conteneur->getApiWikini();
                $this->statuts = $this->conteneur->getApiStatuts();
                $this->referentiel = $this->conteneur->getParametre('referentiel');
        }
        
        public function getBloc() {
                $donnees = array();
                $donnees['statuts'] = $this->getStatutsZoneGeo();
                if(empty($statuts)) {
                        $donnees['wikini'] = $this->getWikini();
                }
                return $donnees;
        }
        
        public function obtenirDonnees() {
                $donnees = array();
                $donnees['wikini'] = $this->getWikini();
                $donnees['statuts'] = $this->getStatuts();
                return $donnees;
        }
        
        private function getStatuts() {
                $statuts = "";
                $projet = Config::get($this->referentiel.'.baseStatuts');
                if ($projet != "") {
                        $nnr = $this->nomCourant->getNnr();
                        $statuts = $this->statuts->getStatuts($projet, $nnr);
                }
                return $statuts;
        }
        
        private function getStatutsZoneGeo() {
                $statuts = "";
                $projet = Config::get($this->referentiel.'.baseStatuts');
                if ($projet != "") {
                        $nnr = $this->nomCourant->getNnr();
                        $statuts = $this->statuts->getStatutsZoneGeo($projet, $nnr);
                }
                return $statuts;
        }
        
        private function getWikini() {
                $wikini = array();
                $wikini['titre'] = 'Wikini';
                $referentiel = $this->conteneur->getParametre('referentiel');
                $num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
                $page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
                $wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
                return $wikini;
        }
}
?>