Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 301 | Rev 793 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 301 Rev 308
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe gérant les noms scientifiques.
4
 * Classe gérant les noms scientifiques.
5
 *
5
 *
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
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
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
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class NomsVernaculaires extends Eflore {
15
class NomsVernaculaires extends Eflore {
16
 
16
 
17
	public function getRechercheComplete($num_tax) {
17
	public function getRechercheComplete($num_tax) {
18
		$tpl = Config::get('nomsVernaRechercheCompleteTpl');
18
		$tpl = Config::get('nomsVernaRechercheCompleteTpl');
19
		$params = array('valeur' => $num_tax, 'projet' => 'nvjfl');
19
		$params = array('valeur' => $num_tax, 'projet' => 'nvjfl');
20
		$url = $this->formaterUrl($tpl, $params);
20
		$url = $this->formaterUrl($tpl, $params);
21
		return $this->chargerDonnees($url);
21
		return $this->chargerDonnees($url);
22
	}
22
	}
-
 
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
	}
23
 
30
 
24
	public function getRechercheEtendue($nom, $type_resultat = '') {
31
	public function getRechercheEtendue($nom, $type_resultat = '') {
25
		$methode = 'getUrlRecherche'.$type_resultat;
32
		$methode = 'getUrlRecherche'.$type_resultat;
26
		if (method_exists($this, $methode)) {
33
		if (method_exists($this, $methode)) {
27
			$url = $this->$methode($nom, 'etendue');
34
			$url = $this->$methode($nom, 'etendue');
28
		} else {
35
		} else {
29
			$url = $this->getUrlRecherche($nom, 'etendue');
36
			$url = $this->getUrlRecherche($nom, 'etendue');
30
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
37
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
31
		}
38
		}
32
		return $this->chargerDonnees($url);
39
		return $this->chargerDonnees($url);
33
	}
40
	}
34
 
41
 
35
	public function getRechercheFloue($nom, $type_resultat = '') {
42
	public function getRechercheFloue($nom, $type_resultat = '') {
36
		$url = $this->getUrlRecherche($nom, 'floue');
43
		$url = $this->getUrlRecherche($nom, 'floue');
37
		return $this->chargerDonnees($url);
44
		return $this->chargerDonnees($url);
38
	}
45
	}
39
 
46
 
40
	private function getUrlRecherche($nom, $typeRech) {
47
	private function getUrlRecherche($nom, $typeRech) {
41
		$tpl = Config::get('nomsVernaRechercheTpl');
48
		$tpl = Config::get('nomsVernaRechercheTpl');
42
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
49
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
43
		$url = $this->formaterUrl($tpl, $params);
50
		$url = $this->formaterUrl($tpl, $params);
44
		return $url;
51
		return $url;
45
	}
52
	}
46
 
53
 
47
	private function getUrlRechercheDetermination($nom, $typeRech) {
54
	private function getUrlRechercheDetermination($nom, $typeRech) {
48
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
55
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
49
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
56
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
50
		$url = $this->formaterUrl($tpl, $params);
57
		$url = $this->formaterUrl($tpl, $params);
51
		return $url;
58
		return $url;
52
	}
59
	}
53
}
60
}
54
?>
61
?>