Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

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