Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 385 Rev 468
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
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
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
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Classification extends aControleur {
15
class Classification extends aControleur {
16
	
16
	
17
	private $conteneur = null;
17
	private $conteneur = null;
18
	private $nomCourant = null;
18
	private $nomCourant = null;
19
	private $taxons = null;
19
	private $taxons = null;
20
 
20
 
21
	public function __construct(Conteneur $conteneur) {
21
	public function __construct(Conteneur $conteneur) {
22
		$this->conteneur = $conteneur;
22
		$this->conteneur = $conteneur;
23
		$this->nomCourant = $this->conteneur->getNomCourant();
23
		$this->nomCourant = $this->conteneur->getNomCourant();
24
		$this->taxons = $this->conteneur->getApiTaxons();
24
		$this->taxons = $this->conteneur->getApiTaxons();
25
		$this->meta = $this->conteneur->getApiMetaDonnees();
25
		$this->meta = $this->conteneur->getApiMetaDonnees();
26
		$this->appUrls = $this->conteneur->getAppUrls();
26
		$this->appUrls = $this->conteneur->getAppUrls();
27
	}
27
	}
28
	
28
	
29
	public function getBloc() {
29
	public function getBloc() {
30
		$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
30
		$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
31
		$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
31
		$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
32
		
32
		
33
		$donnees['taxons_sup'] = is_array($donnees['taxons_sup']) ? array_slice($donnees['taxons_sup'], -3 , 3) : array();
33
		$donnees['taxons_sup'] = is_array($donnees['taxons_sup']) ? array_slice($donnees['taxons_sup'], -3 , 3) : array();
34
		$donnees['taxons_inf'] = is_array($donnees['taxons_inf']) ? array_slice($donnees['taxons_inf'], 0 , 3) : array();
34
		$donnees['taxons_inf'] = is_array($donnees['taxons_inf']) ? array_slice($donnees['taxons_inf'], 0 , 3) : array();
35
		
35
		
36
		return $donnees;
36
		return $donnees;
37
	}
37
	}
38
 
38
 
39
	public function obtenirDonnees() {
39
	public function obtenirDonnees() {
40
		$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
40
		$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
-
 
41
		$donnees['taxon_courant']['rang.libelle'] = $this->nomCourant->getNomRetenu()->get('rang.libelle');
-
 
42
		$donnees['taxon_courant']['nom_sci'] = $this->nomCourant->getNomRetenu()->get('nom_sci');
-
 
43
		$donnees['taxon_courant']['num_nom'] = $this->nomCourant->getNomRetenu()->get('id');
41
		$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
44
		$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
42
		$this->meta->setProjet('bdtfx');
45
		$this->meta->setProjet('bdtfx');
43
		$meta = $this->meta->getMetaDonnees();
46
		$meta = $this->meta->getMetaDonnees();
44
		$titreMeta = $meta[0]['titre'];
47
		$titreMeta = $meta[0]['titre'];
45
		$donnees['meta']['titre'] = $titreMeta;
48
		$donnees['meta']['titre'] = $titreMeta;
46
		$donnees['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
49
		$donnees['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
47
		$donnees['urls'] = $this->appUrls;
50
		$donnees['urls'] = $this->appUrls;
48
		
51
		
49
		return $donnees;
52
		return $donnees;
50
	}
53
	}
51
	
54
	
52
	private function getTaxonsInferieurs() {
55
	private function getTaxonsInferieurs() {
53
		$num_nom = $this->nomCourant->getNomRetenu()->get('id');
56
		$num_nom = $this->nomCourant->getNomRetenu()->get('id');
54
		$resultat = $this->taxons->getTaxonsInf($num_nom);
57
		$resultat = $this->taxons->getTaxonsInf($num_nom);
55
		
58
		
56
		return $resultat[$num_nom];
59
		return $resultat[$num_nom];
57
	}
60
	}
58
	
61
	
59
}
62
}
60
?>
63
?>