Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 230 | Rev 238 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
71 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>
10
 * @copyright	2011 Tela-Botanica
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
13
 * @version		$Id$
14
 */
15
class Fiche extends aControleur {
230 delphine 16
	private $onglet = 'synthese';
17
 
216 delphine 18
	public function initialiser() {
19
		$this->capturerParametres();
20
	}
71 delphine 21
 
22
	public function executerActionParDefaut() {
23
		$this->executerFiche();
24
	}
25
 
141 delphine 26
	public function executerFiche(){
216 delphine 27
		$donnees_recherche = array('type_nom' => $this->type_nom, 'nom' => $this->nom);
28
		$this->executerAction('Recherche', 'executerAccueil', $donnees_recherche);
219 delphine 29
		$blocs_niveaux = $this->recupererTableauConfig('blocs_fiche_defaut');
30
		$donnees['blocs'] = '"'.str_replace('|', '","', $blocs_niveaux[Registre::get('parametres.niveau')]).'"';
231 aurelien 31
		$donnees['onglet'] = $this->getVue('fiche_'.$this->onglet, $donnees);
32
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil', $donnees), true);
71 delphine 33
	}
216 delphine 34
 
230 delphine 35
	public function executerOnglet(){
231 aurelien 36
		$donnees = array();
37
		header('Content-type: text/html');
230 delphine 38
		echo $this->getVue('fiche_'.$this->onglet, $donnees);
231 aurelien 39
		exit;
230 delphine 40
	}
41
 
216 delphine 42
	private function capturerParametres() {
43
		if (isset($_GET['nom'])) {
44
			$this->nom = $_GET['nom'];
45
		}
46
		if (isset($_GET['type_nom'])) {
47
			$this->type_nom = $_GET['type_nom'];
48
		}
49
 
50
		if (isset($_GET['niveau'])) {
51
			Registre::set('parametres.niveau', $_GET['niveau']);
52
		}
230 delphine 53
		if (isset($_GET['onglet'])) {
54
			$this->onglet = $_GET['onglet'];
55
		}
216 delphine 56
	}
219 delphine 57
 
58
	protected function recupererTableauConfig($param) {
59
		$tableau = array();
60
		$tableauPartiel = explode(',', Config::get($param));
61
		$tableauPartiel = array_map('trim', $tableauPartiel);
62
		foreach ($tableauPartiel as $champ) {
63
			if (strpos($champ, '=') === false) {
64
				$tableau[] = $champ;
65
			} else {
66
				list($cle, $val) = explode('=', $champ);
67
				$tableau[$cle] = $val;
68
			}
69
		}
70
		return $tableau;
71
	}
71 delphine 72
}
73
?>