Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev Author Line No. Line
44 jpm 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 Noms extends Eflore {
133 jpm 16
 
165 delphine 17
	public function getRechercheEtendue($nom, $type_resultat = '') {
18
		$methode = 'getUrlRecherche'.$type_resultat;
19
		if (method_exists($this, $methode)) {
20
			$url = $this->$methode($nom, 'etendue');
21
		} else {
22
			$url = $this->getUrlRecherche($nom, 'etendue');
23
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
24
		}
133 jpm 25
		return $this->chargerDonneesRecursivement($url);
53 delphine 26
	}
133 jpm 27
 
53 delphine 28
	public function getRechercheFloue($nom) {
29
		$url = $this->getUrlRecherche($nom, 'floue');
30
		return $this->chargerDonnees($url);
31
	}
133 jpm 32
 
165 delphine 33
	// retourne les champs par defaut
53 delphine 34
	private function getUrlRecherche($nom, $typeRech) {
35
		$tpl = Config::get('nomsRechercheTpl');
60 jpm 36
		$params = array('valeur' => $nom, 'type' => $typeRech);
53 delphine 37
		$url = $this->formaterUrl($tpl, $params);
38
		return $url;
39
	}
165 delphine 40
 
169 delphine 41
	// retourne les champs par defaut
42
	private function getUrlRechercheAlphab($nom, $typeRech) {
43
		$tpl = Config::get('nomsRechercheAlphabTpl');
44
		$params = array('valeur' => $nom, 'type' => $typeRech);
45
		$url = $this->formaterUrl($tpl, $params);
46
		return $url;
47
	}
48
 
49
	// retourne les champs par defaut
50
	private function getUrlRechercheRetenu($nom, $typeRech) {
51
		$tpl = Config::get('nomsRechercheRetenuTpl');
52
		$params = array('valeur' => $nom, 'type' => $typeRech);
53
		$url = $this->formaterUrl($tpl, $params);
54
		return $url;
55
	}
56
 
57
	private function getUrlRechercheSynonyme($nom, $typeRech) {
58
		$tpl = Config::get('nomsRechercheSynonymeTpl');
59
		$params = array('valeur' => $nom, 'type' => $typeRech);
60
		$url = $this->formaterUrl($tpl, $params);
61
		return $url;
62
	}
63
 
165 delphine 64
	// retourne les champs par defaut + nom retenu
65
	private function getUrlRechercheDetermination($nom, $typeRech) {
66
		$tpl = Config::get('nomsRechercheDeterminationTpl');
67
		$params = array('valeur' => $nom, 'type' => $typeRech);
68
		$url = $this->formaterUrl($tpl, $params);
69
		return $url;
70
	}
71
 
72
	// retourne les champs par defaut + nom decompose (au, an et bib)
73
	private function getUrlRechercheDecompo($nom, $typeRech) {
74
		$tpl = Config::get('nomsRechercheDecompoTpl');
75
		$params = array('valeur' => $nom, 'type' => $typeRech);
76
		$url = $this->formaterUrl($tpl, $params);
77
		return $url;
78
	}
44 jpm 79
}
80
?>