Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
291 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe Onglet Synthese.
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>
10
 * @author		Grégoire DUCHÉ <gregoire@tela-botanica.org>
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
 */
16
class Synthese extends aControleur {
17
 
18
	private $conteneur = null;
294 delphine 19
	private $nomCourant = null;
291 jpm 20
 
21
	public function __construct(Conteneur $conteneur) {
22
		$this->conteneur = $conteneur;
294 delphine 23
		$this->nomCourant = $this->conteneur->getNomCourant();
744 aurelien 24
 
25
		parent::__construct();
291 jpm 26
	}
27
 
28
	public function obtenirDonnees() {
29
		$donnees = array();
744 aurelien 30
		$num_nom = $this->nomCourant->getNns();
389 aurelien 31
 
876 aurelien 32
		$blocs = array('illustrations','repartition','nomenclature','description',
33
				'ethnobotanique','bibliographie','statut','ecologie');
34
		$cache = array();
35
 
389 aurelien 36
		$nt = $this->conteneur->getNomCourant()->getNomRetenu()->get('num_taxonomique');
37
		$donnees['infos'] = array('referentiel' => $this->conteneur->getParametre('referentiel'), 'num_tax' => $nt);
876 aurelien 38
		foreach ($blocs as $bloc) {
39
			$cache_bloc = Config::get('cache') ? $this->obtenirCache($bloc.'_bloc_'.$num_nom) : null;
40
			if($cache_bloc != null) {
41
				$donnees[$bloc] = $cache_bloc;
42
			} else {
43
				$nom_classe = ucfirst($bloc);
44
				$classe = new $nom_classe($this->conteneur);
45
				$donnees[$bloc] = $classe->getBloc();
46
				if(!empty($donnees[$bloc])) {
47
					$this->mettreEnCache($bloc.'_bloc_'.$num_nom, $donnees[$bloc]);
48
				}
744 aurelien 49
			}
50
		}
291 jpm 51
		return $donnees;
52
	}
53
}
54
?>