Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 422 | Rev 558 | Go to most recent revision | Details | Compare with Previous | 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
 */
422 delphine 15
class Ecologie extends aControleur {
16
	public function __construct(Conteneur $conteneur) {
17
		$this->conteneur = $conteneur;
18
		$this->nomCourant = $this->conteneur->getNomCourant();
540 mathilde 19
		$this->informations = $this->conteneur->getApiInformations();
20
		$this->meta = $this->conteneur->getApiMetaDonnees();
422 delphine 21
		$this->wikini = $this->conteneur->getApiWikini();
540 mathilde 22
		$this->appUrls = $this->conteneur->getAppUrls();
422 delphine 23
	}
24
 
25
	public function obtenirDonnees() {
417 aurelien 26
		$donnees = array();
27
		$donnees['wikini'] = $this->getWikini();
540 mathilde 28
		$donnees['baseflor'] = $this->getBaseflor();
272 delphine 29
		return $donnees;
30
	}
417 aurelien 31
 
32
	private function getWikini() {
33
		$wikini = array();
34
		$wikini['titre'] = 'Wikini';
35
		$referentiel = $this->conteneur->getParametre('referentiel');
36
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
37
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
418 aurelien 38
		$wikini['ecologie'] = $this->wikini->getTexteFormate($page_wiki, 'ecologie');
417 aurelien 39
		return $wikini;
40
	}
540 mathilde 41
 
42
	private function getBaseflor() {
43
		$baseflor = array();
44
		$this->informations ->setProjet('baseflor');
45
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
46
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
47
		$informations = $this->informations->getInformations();
48
		if($informations != ""){
49
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
50
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
51
			$this->meta->setProjet('baseflor');
52
			$meta = $this->meta->getMetaDonnees();
53
			$citation = $meta[0]['citation'];
54
			$baseflor['meta']['citation'] = $citation;
55
			$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
56
		}else {
57
			$baseflor['aucune'] = 'Aucunes données';
58
		}
59
		return $baseflor;
60
	}
272 delphine 61
}
62
?>