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 {
|
291 |
jpm |
16 |
|
|
|
17 |
public function getSynonymes($nn) {
|
283 |
delphine |
18 |
$tpl = Config::get('nomsSynonymesTpl');
|
291 |
jpm |
19 |
$params = array('id' => $nn);
|
283 |
delphine |
20 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
21 |
return $this->chargerDonnees($url);
|
|
|
22 |
}
|
336 |
aurelien |
23 |
|
|
|
24 |
public function getFlores($nn) {
|
|
|
25 |
$tpl = Config::get('nomsFloresTpl');
|
|
|
26 |
$params = array('id' => $nn);
|
|
|
27 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
28 |
return $this->chargerDonnees($url);
|
|
|
29 |
}
|
291 |
jpm |
30 |
|
|
|
31 |
public function getNom($nn) {
|
|
|
32 |
$url = $this->getUrlNom($nn);
|
|
|
33 |
return $this->chargerDonnees($url);
|
|
|
34 |
}
|
370 |
aurelien |
35 |
|
|
|
36 |
public function getNomFormateHtml($nn) {
|
|
|
37 |
$url = $this->getUrlNomFormateHtml($nn);
|
|
|
38 |
$retour = $this->chargerDonnees($url);
|
|
|
39 |
return $retour['nom_sci'];
|
|
|
40 |
}
|
291 |
jpm |
41 |
|
165 |
delphine |
42 |
public function getRechercheEtendue($nom, $type_resultat = '') {
|
|
|
43 |
$methode = 'getUrlRecherche'.$type_resultat;
|
|
|
44 |
if (method_exists($this, $methode)) {
|
|
|
45 |
$url = $this->$methode($nom, 'etendue');
|
|
|
46 |
} else {
|
|
|
47 |
$url = $this->getUrlRecherche($nom, 'etendue');
|
|
|
48 |
Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
|
|
|
49 |
}
|
133 |
jpm |
50 |
return $this->chargerDonneesRecursivement($url);
|
53 |
delphine |
51 |
}
|
133 |
jpm |
52 |
|
53 |
delphine |
53 |
public function getRechercheFloue($nom) {
|
|
|
54 |
$url = $this->getUrlRecherche($nom, 'floue');
|
|
|
55 |
return $this->chargerDonnees($url);
|
|
|
56 |
}
|
133 |
jpm |
57 |
|
291 |
jpm |
58 |
private function getUrlNom($nn) {
|
|
|
59 |
$tpl = Config::get('nomTpl');
|
|
|
60 |
$params = array('id' => $nn);
|
|
|
61 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
62 |
return $url;
|
|
|
63 |
}
|
370 |
aurelien |
64 |
|
|
|
65 |
private function getUrlNomFormateHtml($nn) {
|
|
|
66 |
$tpl = Config::get('nomFormateHtmlTpl');
|
|
|
67 |
$params = array('id' => $nn);
|
|
|
68 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
69 |
return $url;
|
|
|
70 |
}
|
291 |
jpm |
71 |
|
165 |
delphine |
72 |
// retourne les champs par defaut
|
53 |
delphine |
73 |
private function getUrlRecherche($nom, $typeRech) {
|
|
|
74 |
$tpl = Config::get('nomsRechercheTpl');
|
60 |
jpm |
75 |
$params = array('valeur' => $nom, 'type' => $typeRech);
|
53 |
delphine |
76 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
77 |
return $url;
|
|
|
78 |
}
|
291 |
jpm |
79 |
|
169 |
delphine |
80 |
// retourne les champs par defaut
|
|
|
81 |
private function getUrlRechercheAlphab($nom, $typeRech) {
|
|
|
82 |
$tpl = Config::get('nomsRechercheAlphabTpl');
|
|
|
83 |
$params = array('valeur' => $nom, 'type' => $typeRech);
|
|
|
84 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
85 |
return $url;
|
|
|
86 |
}
|
291 |
jpm |
87 |
|
169 |
delphine |
88 |
// retourne les champs par defaut
|
|
|
89 |
private function getUrlRechercheRetenu($nom, $typeRech) {
|
|
|
90 |
$tpl = Config::get('nomsRechercheRetenuTpl');
|
|
|
91 |
$params = array('valeur' => $nom, 'type' => $typeRech);
|
|
|
92 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
93 |
return $url;
|
|
|
94 |
}
|
291 |
jpm |
95 |
|
169 |
delphine |
96 |
private function getUrlRechercheSynonyme($nom, $typeRech) {
|
|
|
97 |
$tpl = Config::get('nomsRechercheSynonymeTpl');
|
|
|
98 |
$params = array('valeur' => $nom, 'type' => $typeRech);
|
|
|
99 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
100 |
return $url;
|
|
|
101 |
}
|
291 |
jpm |
102 |
|
165 |
delphine |
103 |
// retourne les champs par defaut + nom retenu
|
|
|
104 |
private function getUrlRechercheDetermination($nom, $typeRech) {
|
|
|
105 |
$tpl = Config::get('nomsRechercheDeterminationTpl');
|
|
|
106 |
$params = array('valeur' => $nom, 'type' => $typeRech);
|
|
|
107 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
108 |
return $url;
|
|
|
109 |
}
|
291 |
jpm |
110 |
|
165 |
delphine |
111 |
// retourne les champs par defaut + nom decompose (au, an et bib)
|
|
|
112 |
private function getUrlRechercheDecompo($nom, $typeRech) {
|
|
|
113 |
$tpl = Config::get('nomsRechercheDecompoTpl');
|
|
|
114 |
$params = array('valeur' => $nom, 'type' => $typeRech);
|
|
|
115 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
116 |
return $url;
|
|
|
117 |
}
|
44 |
jpm |
118 |
}
|
|
|
119 |
?>
|