Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Go to most recent revision | Details | 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 {
301 jpm 16
 
284 aurelien 17
	public function getRechercheComplete($num_tax) {
18
		$tpl = Config::get('nomsVernaRechercheCompleteTpl');
19
		$params = array('valeur' => $num_tax, 'projet' => 'nvjfl');
20
		$url = $this->formaterUrl($tpl, $params);
21
		return $this->chargerDonnees($url);
22
	}
308 aurelien 23
 
24
	public function getRechercheLimitee($num_tax) {
25
		$tpl = Config::get('nomsVernaRechercheLimiteeTpl');
26
		$params = array('valeur' => $num_tax, 'projet' => 'nvjfl');
27
		$url = $this->formaterUrl($tpl, $params);
28
		return $this->chargerDonnees($url);
29
	}
301 jpm 30
 
165 delphine 31
	public function getRechercheEtendue($nom, $type_resultat = '') {
32
		$methode = 'getUrlRecherche'.$type_resultat;
33
		if (method_exists($this, $methode)) {
34
			$url = $this->$methode($nom, 'etendue');
35
		} else {
36
			$url = $this->getUrlRecherche($nom, 'etendue');
37
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
38
		}
53 delphine 39
		return $this->chargerDonnees($url);
40
	}
301 jpm 41
 
165 delphine 42
	public function getRechercheFloue($nom, $type_resultat = '') {
53 delphine 43
		$url = $this->getUrlRecherche($nom, 'floue');
44
		return $this->chargerDonnees($url);
45
	}
301 jpm 46
 
53 delphine 47
	private function getUrlRecherche($nom, $typeRech) {
48
		$tpl = Config::get('nomsVernaRechercheTpl');
196 delphine 49
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
53 delphine 50
		$url = $this->formaterUrl($tpl, $params);
51
		return $url;
52
	}
301 jpm 53
 
165 delphine 54
	private function getUrlRechercheDetermination($nom, $typeRech) {
196 delphine 55
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
56
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
165 delphine 57
		$url = $this->formaterUrl($tpl, $params);
58
		return $url;
59
	}
793 mathilde 60
 
61
	private function getUrlRechercheAlphab($nom, $typeRech) {
62
		$tpl = Config::get('nomsVernaRechercheAlphabTpl');
63
		$params = array('valeur' => $nom, 'type' => $typeRech);
64
		$url = $this->formaterUrl($tpl, $params);
65
		return $url;
66
	}
53 delphine 67
}
68
?>