Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 540 | Rev 568 | 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>
558 mathilde 10
 * @author		Mathilde Salthun-lassalle <mathilde@tela-botanica.org>
272 delphine 11
 * @copyright	2011 Tela-Botanica
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
13
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
14
 * @version		$Id$
15
 */
422 delphine 16
class Ecologie extends aControleur {
17
	public function __construct(Conteneur $conteneur) {
18
		$this->conteneur = $conteneur;
19
		$this->nomCourant = $this->conteneur->getNomCourant();
540 mathilde 20
		$this->informations = $this->conteneur->getApiInformations();
21
		$this->meta = $this->conteneur->getApiMetaDonnees();
422 delphine 22
		$this->wikini = $this->conteneur->getApiWikini();
540 mathilde 23
		$this->appUrls = $this->conteneur->getAppUrls();
422 delphine 24
	}
25
 
26
	public function obtenirDonnees() {
417 aurelien 27
		$donnees = array();
28
		$donnees['wikini'] = $this->getWikini();
540 mathilde 29
		$donnees['baseflor'] = $this->getBaseflor();
272 delphine 30
		return $donnees;
31
	}
417 aurelien 32
 
33
	private function getWikini() {
34
		$wikini = array();
35
		$wikini['titre'] = 'Wikini';
36
		$referentiel = $this->conteneur->getParametre('referentiel');
37
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
38
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
418 aurelien 39
		$wikini['ecologie'] = $this->wikini->getTexteFormate($page_wiki, 'ecologie');
417 aurelien 40
		return $wikini;
41
	}
540 mathilde 42
 
558 mathilde 43
	public function getBloc() {
44
		$donnees['titre'] = "Optimum écologique";
45
		$donnees=$this->getBaseflor();
46
		return $donnees;
47
	}
48
 
540 mathilde 49
	private function getBaseflor() {
50
		$baseflor = array();
51
		$this->informations ->setProjet('baseflor');
52
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
53
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
54
		$informations = $this->informations->getInformations();
55
		if($informations != ""){
56
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
57
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
558 mathilde 58
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
59
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
540 mathilde 60
			$this->meta->setProjet('baseflor');
61
			$meta = $this->meta->getMetaDonnees();
62
			$citation = $meta[0]['citation'];
63
			$baseflor['meta']['citation'] = $citation;
64
			$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
558 mathilde 65
			$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420";
66
			$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420";
67
			$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png";
68
			$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png";
540 mathilde 69
		}else {
70
			$baseflor['aucune'] = 'Aucunes données';
71
		}
72
		return $baseflor;
73
	}
272 delphine 74
}
75
?>