Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 1324 Rev 1355
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 vernaculaires
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($referentiel, $num_tax) {
17
	public function getRechercheComplete($referentiel, $num_tax) {
18
		$tpl = Config::get('nomsVernaRechercheCompleteTpl');
18
		$tpl = Config::get('nomsVernaRechercheCompleteTpl');
19
		$params = array('valeur' => $num_tax, 'projet' => $referentiel);
19
		$params = array('valeur' => $num_tax, 'projet' => $referentiel);
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
	
23
	
24
	public function getRechercheLimitee($referentiel, $num_tax) {
24
	public function getRechercheLimitee($referentiel, $num_tax) {
25
		$tpl = Config::get('nomsVernaRechercheLimiteeTpl');
25
		$tpl = Config::get('nomsVernaRechercheLimiteeTpl');
26
		$params = array('valeur' => $num_tax, 'projet' => $referentiel);
26
		$params = array('valeur' => $num_tax, 'projet' => $referentiel);
27
		$url = $this->formaterUrl($tpl, $params);
27
		$url = $this->formaterUrl($tpl, $params);
28
		return $this->chargerDonnees($url);
28
		return $this->chargerDonnees($url);
29
	}
29
	}
30
 
30
 
31
	public function getRechercheEtendue($nom, $type_resultat = '') {
31
	public function getRechercheEtendue($nom, $type_resultat = '') {
32
		$methode = 'getUrlRecherche'.$type_resultat;
32
		$methode = 'getUrlRecherche'.$type_resultat;
33
		if (method_exists($this, $methode)) {
33
		if (method_exists($this, $methode)) {
34
			$url = $this->$methode($nom, 'etendue');
34
			$url = $this->$methode($nom, 'etendue');
35
		} else {
35
		} else {
36
			$url = $this->getUrlRecherche($nom, 'etendue');
36
			$url = $this->getUrlRecherche($nom, 'etendue');
37
			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.");
38
		}
38
		}
39
		return $this->chargerDonnees($url);
39
		return $this->chargerDonnees($url);
40
	}
40
	}
41
 
41
 
42
	public function getRechercheFloue($nom, $type_resultat = '') {
42
	public function getRechercheFloue($nom, $type_resultat = '') {
43
		$url = $this->getUrlRecherche($nom, 'floue');
43
		$url = $this->getUrlRecherche($nom, 'floue');
44
		return $this->chargerDonnees($url);
44
		return $this->chargerDonnees($url);
45
	}
45
	}
46
 
46
 
47
	private function getUrlRecherche($nom, $typeRech) {
47
	private function getUrlRecherche($nom, $typeRech) {
48
		$tpl = Config::get('nomsVernaRechercheTpl');
48
		$tpl = Config::get('nomsVernaRechercheTpl');
49
		$params = array('valeur' => $nom, 'type' => $typeRech);
49
		$params = array('valeur' => $nom, 'type' => $typeRech);
50
		$url = $this->formaterUrl($tpl, $params);
50
		$url = $this->formaterUrl($tpl, $params);
51
		return $url;
51
		return $url;
52
	}
52
	}
53
 
53
 
54
	private function getUrlRechercheDetermination($nom, $typeRech) {
54
	private function getUrlRechercheDetermination($nom, $typeRech) {
55
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
55
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
56
		$params = array('valeur' => $nom, 'type' => $typeRech);
56
		$params = array('valeur' => $nom, 'type' => $typeRech);
57
		$url = $this->formaterUrl($tpl, $params);
57
		$url = $this->formaterUrl($tpl, $params);
58
		return $url;
58
		return $url;
59
	}
59
	}
60
	
60
	
61
	private function getUrlRechercheAlphab($nom, $typeRech) {
61
	private function getUrlRechercheAlphab($nom, $typeRech) {
62
		$tpl = Config::get('nomsVernaRechercheAlphabTpl');
62
		$tpl = Config::get('nomsVernaRechercheAlphabTpl');
63
		$params = array('valeur' => $nom, 'type' => $typeRech);
63
		$params = array('valeur' => $nom, 'type' => $typeRech);
64
		$url = $this->formaterUrl($tpl, $params);
64
		$url = $this->formaterUrl($tpl, $params);
65
		return $url;
65
		return $url;
66
	}
66
	}
67
}
67
}
68
?>
68
?>