Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 697 | Rev 763 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 697 Rev 752
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe mère du module Liste.
4
 * Classe mère du module Liste.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @author		Mathilde Salthun-lassalle <mathilde@tela-botanica.org>
10
 * @author		Mathilde Salthun-lassalle <mathilde@tela-botanica.org>
11
 * @copyright	2011 Tela-Botanica
11
 * @copyright	2011 Tela-Botanica
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
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
13
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
14
 * @version		$Id$
14
 * @version		$Id$
15
 */
15
 */
16
class Ecologie extends aControleur {
16
class Ecologie extends aControleur {
17
	
17
	
18
	public function __construct(Conteneur $conteneur) {
18
	public function __construct(Conteneur $conteneur) {
19
		$this->conteneur = $conteneur;
19
		$this->conteneur = $conteneur;
20
		$this->nomCourant = $this->conteneur->getNomCourant();
20
		$this->nomCourant = $this->conteneur->getNomCourant();
21
		$this->informations = $this->conteneur->getApiInformations();
21
		$this->informations = $this->conteneur->getApiInformations();
22
		$this->meta = $this->conteneur->getApiMetaDonnees();
22
		$this->meta = $this->conteneur->getApiMetaDonnees();
23
		$this->wikini = $this->conteneur->getApiWikini();
23
		$this->wikini = $this->conteneur->getApiWikini();
24
		$this->appUrls = $this->conteneur->getAppUrls();
24
		$this->appUrls = $this->conteneur->getAppUrls();
25
		$this->graphique = $this->conteneur->getApiGraphiques();
25
		$this->graphique = $this->conteneur->getApiGraphiques();
26
		
26
		
27
	}
27
	}
28
	
28
	
29
	public function obtenirDonnees() {
29
	public function obtenirDonnees() {
30
		$donnees = array();
30
		$donnees = array();
31
		$donnees['wikini'] = $this->getWikini();
31
		$donnees['wikini'] = $this->getWikini();
32
		$donnees['baseflor'] = $this->getBaseflor();
32
		$donnees['baseflor'] = $this->getBaseflor();
33
		return $donnees;
33
		return $donnees;
34
	}
34
	}
35
	
35
	
36
	public function obtenirDonneesEXport() {
36
	public function obtenirDonneesEXport() {
37
		$donnees = array();
37
		$donnees = array();
38
		$donnees['wikini'] = $this->getWikini();
38
		$donnees['wikini'] = $this->getWikini();
39
		$donnees['baseflor'] = $this->getBaseflorExport();
39
		$donnees['baseflor'] = $this->getBaseflorExport();
40
		return $donnees;
40
		return $donnees;
41
	}
41
	}
42
	
42
	
43
	private function getWikini() {
43
	private function getWikini() {
44
		$wikini = array();
44
		$wikini = array();
45
		$wikini['titre'] = 'Wikini';
45
		$wikini['titre'] = 'Wikini';
46
		$referentiel = $this->conteneur->getParametre('referentiel');
46
		$referentiel = $this->conteneur->getParametre('referentiel');
47
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
47
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
48
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
48
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
49
		$wikini['ecologie'] = $this->wikini->getTexteFormate($page_wiki, 'ecologie');
49
		$wikini['ecologie'] = $this->wikini->getTexteFormate($page_wiki, 'ecologie');
50
		return $wikini;
50
		return $wikini;
51
	}
51
	}
52
	
52
	
53
	public function getBloc() {
53
	public function getBloc() {
54
		$donnees = array();
54
		$donnees = array();
55
		$donnees = $this->getBaseflor();
55
		$donnees = $this->getBaseflor(false);
56
		$donnees['titre'] = 'Optimum écologique';
56
		$donnees['titre'] = 'Optimum écologique';
57
		return $donnees;
57
		return $donnees;
58
	}
58
	}
59
	
59
	
60
	private function getBaseflorExport() {
60
	private function getBaseflorExport() {
61
		$baseflor = array();
61
		$baseflor = array();
62
		$this->informations ->setProjet('baseflor');
62
		$this->informations ->setProjet('baseflor');
63
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
63
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
64
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
64
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
65
		$informations = $this->informations->getInformationsEcologie();
65
		$informations = $this->informations->getInformationsEcologie();
66
		if($informations != ""){
66
		if($informations != ""){
67
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
67
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
68
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
68
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
69
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
69
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
70
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
70
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
71
			$this->graphique -> setProjet('baseflor');
71
			$this->graphique -> setProjet('baseflor');
72
			$baseflor['legende_eco'] = Config::get('chemin_images').'legende_formes.png';
72
			$baseflor['legende_eco'] = Config::get('chemin_images').'legende_formes.png';
73
			$this->meta->setProjet('baseflor');
73
			$this->meta->setProjet('baseflor');
74
			$meta = $this->meta->getMetaDonnees();
74
			$meta = $this->meta->getMetaDonnees();
75
			$citation = $meta[0]['citation'];
75
			$citation = $meta[0]['citation'];
76
			$baseflor['meta']['citation'] = $citation;
76
			$baseflor['meta']['citation'] = $citation;
77
		}else {
77
		}else {
78
			$baseflor['aucune'] = 'Aucunes données';
78
			$baseflor['aucune'] = 'Aucunes données';
79
		}
79
		}
80
		return $baseflor;
80
		return $baseflor;
81
	}
81
	}
82
	
82
	
83
	private function getBaseflor() {
83
	private function getBaseflor($inclure_legende = true) {
84
		$baseflor = array();
84
		$baseflor = array();
85
		$this->informations ->setProjet('baseflor');
85
		$this->informations ->setProjet('baseflor');
86
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
86
		$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
87
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
87
		$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
88
		$informations = $this->informations->getInformationsEcologie();
88
		$informations = $this->informations->getInformationsEcologie();
89
		if($informations != ""){
89
		if($informations != ""){
90
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
90
			$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500";
91
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
91
			$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500";
92
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
92
			$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png";
93
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
93
			$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png";
94
			$this->graphique -> setProjet('baseflor');
94
			$this->graphique -> setProjet('baseflor');
-
 
95
			if($inclure_legende) {
95
			$graphique = $this->graphique->getLegendeGraphique();
96
				$graphique = $this->graphique->getLegendeGraphique();
96
			$baseflor['legende'] =  $graphique ;
97
				$baseflor['legende'] =  $graphique ;
-
 
98
			}
97
			$this->meta->setProjet('baseflor');
99
			$this->meta->setProjet('baseflor');
98
			$meta = $this->meta->getMetaDonnees();
100
			$meta = $this->meta->getMetaDonnees();
99
			$citation = $meta[0]['citation'];
101
			$citation = $meta[0]['citation'];
100
			$baseflor['meta']['citation'] = $citation;
102
			$baseflor['meta']['citation'] = $citation;
101
			$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
103
			$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
102
			$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420";
104
			$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420";
103
			$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420";
105
			$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420";
104
			$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png";
106
			$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png";
105
			$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png";
107
			$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png";
106
		}else {
108
		}else {
107
			$baseflor['aucune'] = 'Aucunes données';
109
			$baseflor['aucune'] = 'Aucunes données';
108
		}
110
		}
109
		return $baseflor;
111
		return $baseflor;
110
	}
112
	}
111
}
113
}
112
?>
114
?>