Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev Author Line No. Line
53 delphine 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe gérant les noms scientifiques.
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 NomsVernaculaires extends Eflore {
16
 
17
 
165 delphine 18
	public function getRechercheEtendue($nom, $type_resultat = '') {
19
		$methode = 'getUrlRecherche'.$type_resultat;
20
		if (method_exists($this, $methode)) {
21
			$url = $this->$methode($nom, 'etendue');
22
		} else {
23
			$url = $this->getUrlRecherche($nom, 'etendue');
24
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
25
		}
53 delphine 26
		return $this->chargerDonnees($url);
27
	}
28
 
165 delphine 29
	public function getRechercheFloue($nom, $type_resultat = '') {
53 delphine 30
		$url = $this->getUrlRecherche($nom, 'floue');
31
		return $this->chargerDonnees($url);
32
	}
33
 
34
	private function getUrlRecherche($nom, $typeRech) {
35
		$tpl = Config::get('nomsVernaRechercheTpl');
86 delphine 36
		$params = array('valeur' => $nom, 'type' => $typeRech);
81 delphine 37
		Debug::printr($params,'Params');
53 delphine 38
		$url = $this->formaterUrl($tpl, $params);
81 delphine 39
		Debug::printr($tpl,'TPL');
40
		Debug::printr($url,'URL');
53 delphine 41
		return $url;
42
	}
165 delphine 43
 
44
	private function getUrlRechercheDetermination($nom, $typeRech) {
45
		$tpl = Config::get('nomsVernaRechercheTpl');
46
		$params = array('valeur' => $nom, 'type' => $typeRech);
47
		Debug::printr($params,'Params');
48
		$url = $this->formaterUrl($tpl, $params);
49
		Debug::printr($tpl,'TPL');
50
		Debug::printr($url,'URL');
51
		return $url;
52
	}
53 delphine 53
}
54
?>