Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1023 | Rev 1130 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1023 Rev 1058
Line 6... Line 6...
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
 * @author		Mathilde Salthun-lassalle <mathilde@tela-botanica.org>
10
 * @author		Mathilde Salthun-lassalle <mathilde@tela-botanica.org>
-
 
11
 * @author		Raphaël Droz <raphael@tela-botanica.org>
11
 * @copyright	2011 Tela-Botanica
12
 * @copyright	2011, 2013 Tela-Botanica
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
13
 * @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
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
14
 * @version		$Id$
15
 * @used by		modules/pdf_export/PdfExport.php::initialiser()
-
 
16
 * @used by		modules/fiche/formateurs/Synthese.php::obtenirDonnees()
15
 */
17
 */
16
class Ecologie extends aControleur {
18
class Ecologie extends aControleur {
Line 17... Line 19...
17
	
19
	
18
	private $referentiel = 'bdtfx';
20
	private $referentiel = 'bdtfx';
Line 153... Line 155...
153
		}
155
		}
154
		return $baseflor;
156
		return $baseflor;
155
	}
157
	}
Line 156... Line 158...
156
	
158
	
157
	private function getBaseflor($inclure_legende = true) {
159
	private function getBaseflor($inclure_legende = true) {
158
		if (Config::get($this->referentiel.'.baseEcologie') != "") {
-
 
159
			$num_nom = $this->nomCourant->getNnr();
160
		if (Config::get($this->referentiel.'.baseEcologie')) {
-
 
161
			$referentiel = $this->conteneur->getParametre('referentiel');
-
 
162
			$num_nom = $this->nomCourant->getNnr();
-
 
163
 
160
			$referentiel = $this->conteneur->getParametre('referentiel');
164
			// TODO: unserialize() pourrait aussi légitimement retourner FALSE
161
			$cache = $this->obtenirCache('baseflor/graphique/'.$referentiel.'_'.$num_nom);
165
			$cache = unserialize($this->conteneur->getCache()->charger('baseflor/graphique/'.$referentiel.'_'.$num_nom));
162
			if($cache != null) {
166
			if($cache) {
163
				$baseflor = $cache;
167
				$baseflor = $cache;
164
				$this->graphique ->setProjet('baseflor');
168
				$this->graphique ->setProjet('baseflor');
165
				$graphique = $this->graphique->getLegendeGraphique();
169
				$graphique = $this->graphique->getLegendeGraphique();
166
				$baseflor['legende'] =  $graphique ;
170
				$baseflor['legende'] =  $graphique ;
Line 194... Line 198...
194
					$meta = $this->meta->getMetaDonnees();
198
					$meta = $this->meta->getMetaDonnees();
195
					$citation = $meta[0]['citation'];
199
					$citation = $meta[0]['citation'];
196
					$baseflor['meta']['citation'] = $citation;
200
					$baseflor['meta']['citation'] = $citation;
197
					$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
201
					$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
Line -... Line 202...
-
 
202
					
198
					
203
					$this->conteneur->getCache()->sauver(serialize($baseflor),
199
					$this->mettreEnCache('baseflor/graphique/'.$referentiel.'_'.$num_nom, $baseflor);
204
														 'baseflor/graphique/'.$referentiel.'_'.$num_nom);
200
				} else {
205
				} else {
201
					$baseflor['aucune'] = 'Aucune donnée';
206
					$baseflor['aucune'] = 'Aucune donnée';
202
				}
207
				}
203
			}
208
			}