Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 361 | Go to most recent revision | Blame | 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 Repartition extends aControleur {

        private $conteneur = null;
        private $nomCourant = null;
        private $tailleBloc = "190x178";
        private $serviceChorodep = null;
        private $cartes;
        private $meta;
        private $appUrls;
        
        public function __construct(Conteneur $conteneur) {
                $this->conteneur = $conteneur;
                $this->nomCourant = $this->conteneur->getNomCourant();
                $this->cartes = $this->conteneur->getApiCartes();
                $this->meta = $this->conteneur->getApiMetaDonnees();
                $this->appUrls = $this->conteneur->getAppUrls();
        }

        public function obtenirDonnees() {
                $donnees['chorodep'] = $this->getChorodep();
                $donnees['eflore'] = $this->getEflore();
                return $donnees;
        }

        public function getChorodep() {
                $this->cartes->setProjet('chorodep');
                $this->cartes->setLargeur('630');
                $id = 'nn:'.$this->nomCourant->getNns();
                $this->cartes->setId($id);
                $chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
                $chorodep['pngUrl'] = $this->cartes->getUrlPng();
                $chorodep['legende'] = $this->cartes->getLegendeId();
                $this->meta->setProjet('chorodep');
                $meta = $this->meta->getMetaDonnees();
                $citation = $meta[0]['citation'];
                $chorodep['meta']['citation'] = $citation;
                $chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
                return $chorodep;
        }
        
        public function getEflore() {
                $this->cartes->setProjet('eflore');
                $this->cartes->setLargeur('max');
                $this->cartes->setInfoNom($this->nomCourant->getNomRetenu());
                $eflore['mapUrl'] = $this->cartes->getUrlMap();
                $eflore['legende'] = $this->cartes->getLegende();
                return $eflore;
        }

        public function getBloc() {
                $this->cartes->setProjet('chorodep');
                $this->cartes->setLargeur('190x178');
                $id = 'nn:'.$this->nomCourant->getNns();
                $this->cartes->setId($id);
                $donnees['carteUrl'] = $this->cartes->getUrlPng();
                return $donnees;
        }
}
?>