Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 284 | Rev 308 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 284 Rev 301
Line 11... Line 11...
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
	
23
 
24
	public function getRechercheEtendue($nom, $type_resultat = '') {
24
	public function getRechercheEtendue($nom, $type_resultat = '') {
25
		$methode = 'getUrlRecherche'.$type_resultat;
25
		$methode = 'getUrlRecherche'.$type_resultat;
26
		if (method_exists($this, $methode)) {
26
		if (method_exists($this, $methode)) {
27
			$url = $this->$methode($nom, 'etendue');
27
			$url = $this->$methode($nom, 'etendue');
28
		} else {
28
		} else {
29
			$url = $this->getUrlRecherche($nom, 'etendue');
29
			$url = $this->getUrlRecherche($nom, 'etendue');
30
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
30
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
31
		}
31
		}
32
		return $this->chargerDonnees($url);
32
		return $this->chargerDonnees($url);
33
	}
33
	}
34
	
34
 
35
	public function getRechercheFloue($nom, $type_resultat = '') {
35
	public function getRechercheFloue($nom, $type_resultat = '') {
36
		$url = $this->getUrlRecherche($nom, 'floue');
36
		$url = $this->getUrlRecherche($nom, 'floue');
37
		return $this->chargerDonnees($url);
37
		return $this->chargerDonnees($url);
38
	}
38
	}
39
	
39
 
40
	private function getUrlRecherche($nom, $typeRech) {
40
	private function getUrlRecherche($nom, $typeRech) {
41
		$tpl = Config::get('nomsVernaRechercheTpl');
41
		$tpl = Config::get('nomsVernaRechercheTpl');
42
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
42
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
43
		$url = $this->formaterUrl($tpl, $params);
43
		$url = $this->formaterUrl($tpl, $params);
44
		return $url;
44
		return $url;
45
	}
45
	}
46
	
46
 
47
	private function getUrlRechercheDetermination($nom, $typeRech) {
47
	private function getUrlRechercheDetermination($nom, $typeRech) {
48
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
48
		$tpl = Config::get('nomsVernaRechercheDeterminationTpl');
49
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
49
		$params = array('valeur' => $nom, 'type' => $typeRech, 'langue' => 'fra');
50
		$url = $this->formaterUrl($tpl, $params);
50
		$url = $this->formaterUrl($tpl, $params);
51
		return $url;
51
		return $url;