Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 340 Rev 379
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->getTaxonsSuperieurs();
30
		$donnees['taxons_sup'] = $this->getTaxonsSuperieurs();
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'], 0 , 3) : array();
33
		$donnees['taxons_sup'] = is_array($donnees['taxons_sup']) ? array_slice($donnees['taxons_sup'], 0 , 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->getTaxonsSuperieurs();
40
		$donnees['taxons_sup'] = $this->nomCourant->taxons_sup;
41
		$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
41
		$donnees['taxons_inf'] = $this->getTaxonsInferieurs();
42
		$this->meta->setProjet('bdtfx');
42
		$this->meta->setProjet('bdtfx');
43
		$meta = $this->meta->getMetaDonnees();
43
		$meta = $this->meta->getMetaDonnees();
44
		$titreMeta = $meta[0]['titre'];
44
		$titreMeta = $meta[0]['titre'];
45
		$donnees['meta']['titre'] = $titreMeta;
45
		$donnees['meta']['titre'] = $titreMeta;
46
		$donnees['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
46
		$donnees['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
47
		$donnees['urls'] = $this->appUrls;
47
		$donnees['urls'] = $this->appUrls;
48
		
48
		
49
		return $donnees;
49
		return $donnees;
50
	}
50
	}
51
	
51
	
52
	private function getTaxonsInferieurs() {
52
	private function getTaxonsInferieurs() {
53
		$num_nom = $this->nomCourant->getNomRetenu()->get('id');
53
		$num_nom = $this->nomCourant->getNomRetenu()->get('id');
54
		$resultat = $this->taxons->getTaxonsInf($num_nom);
54
		$resultat = $this->taxons->getTaxonsInf($num_nom);
55
		
55
		
56
		return $resultat[$num_nom];
56
		return $resultat[$num_nom];
57
	}
57
	}
58
	
58
	
59
	private function getTaxonsSuperieurs() {
59
	private function getTaxonsSuperieurs() {
60
		$num_nom = $this->nomCourant->getNomRetenu()->get('id');
60
		$num_nom = $this->nomCourant->getNomRetenu()->get('id');
61
		$resultat = $this->taxons->getTaxonsSup($num_nom);
61
		$resultat = $this->taxons->getTaxonsSup($num_nom);
62
		
62
		
63
		return $resultat[$num_nom];
63
		return $resultat[$num_nom];
64
	}
64
	}
65
}
65
}
66
?>
66
?>