Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 568 | Rev 606 | 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 {
568 mathilde 17
 
422 delphine 18
	public function __construct(Conteneur $conteneur) {
19
		$this->conteneur = $conteneur;
20
		$this->nomCourant = $this->conteneur->getNomCourant();
540 mathilde 21
		$this->informations = $this->conteneur->getApiInformations();
22
		$this->meta = $this->conteneur->getApiMetaDonnees();
422 delphine 23
		$this->wikini = $this->conteneur->getApiWikini();
540 mathilde 24
		$this->appUrls = $this->conteneur->getAppUrls();
568 mathilde 25
		$this->graphique = $this->conteneur->getApiGraphiques();
26
 
422 delphine 27
	}
28
 
29
	public function obtenirDonnees() {
417 aurelien 30
		$donnees = array();
31
		$donnees['wikini'] = $this->getWikini();
540 mathilde 32
		$donnees['baseflor'] = $this->getBaseflor();
272 delphine 33
		return $donnees;
34
	}
417 aurelien 35
 
36
	private function getWikini() {
37
		$wikini = array();
38
		$wikini['titre'] = 'Wikini';
39
		$referentiel = $this->conteneur->getParametre('referentiel');
40
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
41
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
418 aurelien 42
		$wikini['ecologie'] = $this->wikini->getTexteFormate($page_wiki, 'ecologie');
417 aurelien 43
		return $wikini;
44
	}
540 mathilde 45
 
558 mathilde 46
	public function getBloc() {
47
		$donnees['titre'] = "Optimum écologique";
601 mathilde 48
		$donnees = $this->getBaseflor();
558 mathilde 49
		return $donnees;
50
	}
51
 
540 mathilde 52
	private function getBaseflor() {
53
		$baseflor = array();
54
		$this->informations ->setProjet('baseflor');
55
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
56
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
57
		$informations = $this->informations->getInformations();
58
		if($informations != ""){
59
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
60
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
558 mathilde 61
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
62
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
568 mathilde 63
			$this->graphique -> setProjet('baseflor');
64
			$graphique = $this->graphique->getLegendeGraphique();
65
			$baseflor['legende'] =  $graphique ;
540 mathilde 66
			$this->meta->setProjet('baseflor');
67
			$meta = $this->meta->getMetaDonnees();
68
			$citation = $meta[0]['citation'];
69
			$baseflor['meta']['citation'] = $citation;
70
			$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
558 mathilde 71
			$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420";
72
			$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420";
73
			$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png";
74
			$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png";
540 mathilde 75
		}else {
76
			$baseflor['aucune'] = 'Aucunes données';
77
		}
78
		return $baseflor;
79
	}
272 delphine 80
}
81
?>