Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 601 | Rev 607 | 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() {
606 mathilde 47
		$donnees = array();
601 mathilde 48
		$donnees = $this->getBaseflor();
606 mathilde 49
		$donnees['titre'] = 'Optimum écologique';
558 mathilde 50
		return $donnees;
51
	}
52
 
540 mathilde 53
	private function getBaseflor() {
54
		$baseflor = array();
55
		$this->informations ->setProjet('baseflor');
56
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
57
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
58
		$informations = $this->informations->getInformations();
59
		if($informations != ""){
60
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
61
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
558 mathilde 62
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
63
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
568 mathilde 64
			$this->graphique -> setProjet('baseflor');
65
			$graphique = $this->graphique->getLegendeGraphique();
66
			$baseflor['legende'] =  $graphique ;
540 mathilde 67
			$this->meta->setProjet('baseflor');
68
			$meta = $this->meta->getMetaDonnees();
69
			$citation = $meta[0]['citation'];
70
			$baseflor['meta']['citation'] = $citation;
71
			$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
558 mathilde 72
			$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420";
73
			$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420";
74
			$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png";
75
			$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png";
540 mathilde 76
		}else {
77
			$baseflor['aucune'] = 'Aucunes données';
78
		}
79
		return $baseflor;
80
	}
272 delphine 81
}
82
?>