Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev Author Line No. Line
773 mathilde 1
<?php
2
/**
3
 * Cette classe est le contrôleur pour l'affichage de listes dans des fancy box.
4
 */
5
 
6
 
7
class ListeFancyBox extends aControleur {
8
 
9
	private $type = '';
10
	private $informations;
11
	private $appUrls;
12
	private $conteneur;
13
	private $referentiel;
14
	private $num_nom;
15
 
16
 
17
	public function __construct() {
18
		$this->capturerParametres();
19
		$this->conteneur = new Conteneur($this->parametres);
20
		$this->informations = $this->conteneur->getApiInformations();
21
		$this->appUrls = $this->conteneur->getAppUrls();
22
	}
23
 
24
 
25
	private function capturerParametres() {
26
		if (isset($_GET['type'])) {
27
			$this->type = $_GET['type'];
28
		}
29
		if (isset($_GET['referentiel'])) {
30
			$this->referentiel = $_GET['referentiel'];
31
		}
32
		if (isset($_GET['num_nom'])) {
33
			$this->num_nom = $_GET['num_nom'];
34
		}
35
	}
36
 
37
	public function executerActionParDefaut() {
38
		$this->executerLister();
39
	}
40
 
41
	public function executerLister($donnees) {
42
		header('Content-type: text/html');
43
		$html = $this->chargerListeHtml();
44
		echo $html;
45
		exit;
46
	}
47
 
48
	public function chargerListeHtml() {
49
		$donnees['liste'] = '';
50
		$html = '';
51
		if ($this->type == 'catminat') {
52
			$donnees = $this->getListeCatminat('0','*');
53
			$donnees['urls'] = $this->appUrls;
54
 
55
		}
56
		if ($donnees != '') {
57
			$html = $this->getVue(dirname(__FILE__).'/squelettes/liste-fancy-box', $donnees);
58
		}
59
		return $html;
60
	}
61
 
62
 
63
	public function getListeCatminat($depart, $limite) {
64
		$Catminat = array();
65
		$this->informations ->setProjet('baseflor');
66
		$this->informations ->setBdnt($this->referentiel);
67
		$this->informations ->setNum_nom($this->num_nom);
68
		$this->informations ->setDepart($depart);
69
		$this->informations ->setLimite($limite);
70
		$informations = $this->informations->getInformationsRelationCatminat();
71
		if($informations != ""){
72
			$Catminat['listecatminat'] = $informations['resultat'];
73
			$Catminat['catminat'] = $informations['resultat'][0]['catminat_code'];
74
		}
75
		return $Catminat;
76
	}
77
 
78
}
79
?>