Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 813 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 813 Rev 826
1
<?php
1
<?php
2
/**
2
/**
3
 * Cette classe est le contrôleur pour l'affichage de listes dans des fancy box.(fenêtres)
3
 * Cette classe est le contrôleur pour l'affichage de listes dans des fenêtre fancy box.(fenêtres phytosociologie)
-
 
4
 * 
-
 
5
 * @category	PHP 5.2
-
 
6
 * @package		eflore-consultation
-
 
7
 * @author		Mathilde Salthun-lassalle <mathilde@tela-botanica.org>
-
 
8
 * @copyright	2012 Tela-Botanica
-
 
9
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
-
 
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
-
 
11
 * @version		$Id$
4
 */
12
 */
5
 
13
 
6
 
14
 
7
class ListeFancyBoxPhytosocio extends aControleur {
15
class ListeFancyBoxPhytosocio extends aControleur {
8
	
16
	
9
	private $type = '';
17
	private $type = '';
10
	private $informations;
18
	private $informations;
11
	private $appUrls;
19
	private $appUrls;
12
	private $conteneur;
20
	private $conteneur;
13
	private $referentiel;
21
	private $referentiel;
14
	private $num_nom;
22
	private $num_nom;
15
	private $catminat;
23
	private $catminat;
16
	
24
	
17
	
25
	
18
	public function __construct() {
26
	public function __construct() {
19
		$this->capturerParametres();
27
		$this->capturerParametres();
20
		$this->conteneur = new Conteneur($this->parametres);
28
		$this->conteneur = new Conteneur($this->parametres);
21
		$this->informations = $this->conteneur->getApiInformations();
29
		$this->informations = $this->conteneur->getApiInformations();
22
		$this->syntaxons = $this->conteneur->getApiSyntaxons();
30
		$this->syntaxons = $this->conteneur->getApiSyntaxons();
23
		$this->appUrls = $this->conteneur->getAppUrls();
31
		$this->appUrls = $this->conteneur->getAppUrls();
24
	}
32
	}
25
	
33
	
26
	
34
	
27
	private function capturerParametres() {
35
	private function capturerParametres() {
28
		if (isset($_GET['type'])) {
36
		if (isset($_GET['type'])) {
29
			$this->type = $_GET['type'];
37
			$this->type = $_GET['type'];
30
		}
38
		}
31
		if (isset($_GET['referentiel'])) {
39
		if (isset($_GET['referentiel'])) {
32
			$this->referentiel = $_GET['referentiel'];
40
			$this->referentiel = $_GET['referentiel'];
33
		}
41
		}
34
		if (isset($_GET['num_nom'])) {
42
		if (isset($_GET['num_nom'])) {
35
			$this->num_nom = $_GET['num_nom'];
43
			$this->num_nom = $_GET['num_nom'];
36
		}
44
		}
37
		if (isset($_GET['catminat'])) {
45
		if (isset($_GET['catminat'])) {
38
			$this->catminat= trim(urldecode($_GET['catminat']));
46
			$this->catminat= trim(urldecode($_GET['catminat']));
39
		}
47
		}
40
	}
48
	}
41
	
49
	
42
	public function executerActionParDefaut() {
50
	public function executerActionParDefaut() {
43
		$this->executerLister();
51
		$this->executerLister();
44
	}
52
	}
45
	
53
	
46
	public function executerLister($donnees) {
54
	public function executerLister($donnees) {
47
		header('Content-type: text/html');
55
		header('Content-type: text/html');
48
		$html = $this->chargerListeHtml();
56
		$html = $this->chargerListeHtml();
49
		echo $html;
57
		echo $html;
50
		exit;
58
		exit;
51
	}
59
	}
52
	
60
	
53
	public function chargerListeHtml() {
61
	public function chargerListeHtml() {
54
		$donnees['liste'] = '';
62
		$donnees['liste'] = '';
55
		$html = '';
63
		$html = '';
56
		$squelette = dirname(__FILE__).'/squelettes/liste-fancy-box';
64
		$squelette = dirname(__FILE__).'/squelettes/liste-fancy-box';
57
		if ($this->type == 'catminat_taxons') {
65
		if ($this->type == 'catminat_taxons') {
58
			$donnees = $this->getListeCatminatTaxons(); 
66
			$donnees = $this->getListeCatminatTaxons(); 
59
			$squelette .= '-taxons';
67
			$squelette .= '-taxons';
60
		} elseif ($this->type == 'catminat_synonymes') {
68
		} elseif ($this->type == 'catminat_synonymes') {
61
			$donnees = $this->getListeCatminatSynonymes();
69
			$donnees = $this->getListeCatminatSynonymes();
62
			$squelette .= '-synonymes';
70
			$squelette .= '-synonymes';
63
		} elseif ($this->type == 'catminat_ref') {
71
		} elseif ($this->type == 'catminat_ref') {
64
			$donnees = $this->getListeCatminatRef();
72
			$donnees = $this->getListeCatminatRef();
65
			$squelette .= '-ref';
73
			$squelette .= '-ref';
66
		} elseif ($this->type == 'catminat_taxons_sup') {
74
		} elseif ($this->type == 'catminat_taxons_sup') {
67
			$donnees = $this->getListeCatminatTaxonsSup();
75
			$donnees = $this->getListeCatminatTaxonsSup();
68
			$squelette .= '-taxons';
76
			$squelette .= '-taxons';
69
		}
77
		}
70
		if ($donnees['liste'] !== '') {
78
		if ($donnees['liste'] !== '') {
71
			$donnees['urls'] = $this->appUrls;
79
			$donnees['urls'] = $this->appUrls;
72
			$html = $this->getVue($squelette, $donnees);
80
			$html = $this->getVue($squelette, $donnees);
73
		}
81
		}
74
		return $html;
82
		return $html;
75
	}
83
	}
76
	
84
	
77
	
85
	
78
	public function getListeCatminatTaxons() {
86
	public function getListeCatminatTaxons() {
79
		$Catminat = array();
87
		$Catminat = array();
80
		$this->informations ->setProjet('baseflor');
88
		$this->informations ->setProjet('baseflor');
81
		$this->informations ->setDepart(0);
89
		$this->informations ->setDepart(0);
82
		$this->informations ->setLimite('500');
90
		$this->informations ->setLimite('500');
83
		$this->informations ->setBdnt($this->referentiel);
91
		$this->informations ->setBdnt($this->referentiel);
84
		$this->informations ->setNum_nom($this->num_nom);
92
		$this->informations ->setNum_nom($this->num_nom);
85
		$informations = $this->informations->getInformationsRelationCatminat();
93
		$informations = $this->informations->getInformationsRelationCatminat();
86
		if($informations != ""){
94
		if($informations != ""){
87
			$Catminat['liste'] = $informations['resultat'];
95
			$Catminat['liste'] = $informations['resultat'];
88
			$Catminat['catminat'] = $informations['resultat'][0]['catminat_code'];
96
			$Catminat['catminat'] = $informations['resultat'][0]['catminat_code'];
89
		} 	
97
		} 	
90
		return $Catminat;
98
		return $Catminat;
91
	}
99
	}
92
	
100
	
93
	public function getListeCatminatTaxonsSup() {
101
	public function getListeCatminatTaxonsSup() {
94
		$Catminat = array();
102
		$Catminat = array();
95
		$this->informations ->setProjet('baseflor');
103
		$this->informations ->setProjet('baseflor');
96
		$this->informations ->setDepart(0);
104
		$this->informations ->setDepart(0);
97
		$this->informations ->setLimite('500');
105
		$this->informations ->setLimite('500');
98
		$this->informations ->setCatminat($this->catminat);
106
		$this->informations ->setCatminat($this->catminat);
99
		$informations = $this->informations->getInformationsMasqueCatminat();
107
		$informations = $this->informations->getInformationsMasqueCatminat();
100
		if($informations != ""){
108
		if($informations != ""){
101
			$Catminat['liste'] = $informations['resultats'];
109
			$Catminat['liste'] = $informations['resultats'];
102
			$Catminat['catminat'] = str_replace('-','/',$this->catminat);
110
			$Catminat['catminat'] = str_replace('-','/',$this->catminat);
103
		}
111
		}
104
		return $Catminat;
112
		return $Catminat;
105
	}
113
	}
106
	
114
	
107
	public function getListeCatminatSynonymes() {
115
	public function getListeCatminatSynonymes() {
108
		$Catminat = array();
116
		$Catminat = array();
109
		$this->syntaxons->setProjet('baseveg');
117
		$this->syntaxons->setProjet('baseveg');
110
		$this->syntaxons->setCatminat($this->catminat);
118
		$this->syntaxons->setCatminat($this->catminat);
111
		$syntaxons = $this->syntaxons->getSyntaxonsSynonymes();
119
		$syntaxons = $this->syntaxons->getSyntaxonsSynonymes();
112
		if (is_array($syntaxons)) {
120
		if (is_array($syntaxons)) {
113
			$Catminat['liste'] = $syntaxons['resultat'];
121
			$Catminat['liste'] = $syntaxons['resultat'];
114
			$Catminat['catminat'] =  $syntaxons['resultat'][0]['code_catminat'];
122
			$Catminat['catminat'] =  $syntaxons['resultat'][0]['code_catminat'];
115
		}
123
		}
116
		return $Catminat;
124
		return $Catminat;
117
	}
125
	}
118
	
126
	
119
	public function getListeCatminatRef() {
127
	public function getListeCatminatRef() {
120
		$ref = array();
128
		$ref = array();
121
		$this->syntaxons->setProjet('baseveg');
129
		$this->syntaxons->setProjet('baseveg');
122
		$this->syntaxons->setCatminat($this->catminat);
130
		$this->syntaxons->setCatminat($this->catminat);
123
		$syntaxons = $this->syntaxons->getSyntaxonsCatminat();
131
		$syntaxons = $this->syntaxons->getSyntaxonsCatminat();
124
		
-
 
125
		if (is_array($syntaxons)) {
132
		if (is_array($syntaxons)) {
126
			$ref['liste'] = $syntaxons['resultat'][0]['ref_der_biblio'];
133
			$ref['liste']['der'] = $syntaxons['resultat'][0]['ref_der_biblio'];
-
 
134
			if ($syntaxons['resultat'][0]['ref_anteriorite_deux'] != '') {
-
 
135
				$ref['liste']['anteriorites'][0] =  $syntaxons['resultat'][0]['ref_anteriorite_deux'];
-
 
136
			}
-
 
137
			if ($syntaxons['resultat'][0]['ref_anteriorite_trois'] != '') {
-
 
138
				$ref['liste']['anteriorites'][1]= $syntaxons['resultat'][0]['ref_anteriorite_trois'];
-
 
139
			}
-
 
140
			if ($syntaxons['resultat'][0]['ref_anteriorite_quatre'] != '') {
-
 
141
				$ref['liste']['anteriorites'][2] =  $syntaxons['resultat'][0]['ref_anteriorite_quatre'];
-
 
142
			}		
127
		}
143
		}
128
		return $ref;
144
		return $ref;
129
	}
145
	}
130
	
146
	
131
}
147
}
132
?>
148
?>