| Line 31... |
Line 31... |
| 31 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
31 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
| 32 |
$this->appUrls = $this->conteneur->getAppUrls();
|
32 |
$this->appUrls = $this->conteneur->getAppUrls();
|
| 33 |
}
|
33 |
}
|
| Line 34... |
Line 34... |
| 34 |
|
34 |
|
| 35 |
public function obtenirDonnees() {
|
- |
|
| 36 |
$this->getFlores();
|
- |
|
| 37 |
|
35 |
public function obtenirDonnees() {
|
| 38 |
$this->donnees['bibliobota']['references'] = $this->getBiblioBota();
|
36 |
$this->donnees['bibliobota']['references'] = $this->getBiblioBota();
|
| 39 |
$this->meta->setProjet('bibliobota');
|
37 |
$this->meta->setProjet('bibliobota');
|
| 40 |
$meta = $this->meta->getMetaDonnees();
|
38 |
$meta = $this->meta->getMetaDonnees();
|
| 41 |
$this->donnees['bibliobota']['meta'] = $meta[0];
|
39 |
$this->donnees['bibliobota']['meta'] = $meta[0];
|
| Line 44... |
Line 42... |
| 44 |
$this->donnees['wikini'] = $this->getWikini();
|
42 |
$this->donnees['wikini'] = $this->getWikini();
|
| 45 |
return $this->donnees;
|
43 |
return $this->donnees;
|
| 46 |
}
|
44 |
}
|
| Line 47... |
Line 45... |
| 47 |
|
45 |
|
| 48 |
public function getBloc() {
|
- |
|
| 49 |
$this->getFloresBloc();
|
46 |
public function getBloc() {
|
| 50 |
$references = $this->getBiblioBota();
|
47 |
$references = $this->getBiblioBota();
|
| 51 |
$this->donnees['references'] = array_slice($references, 0, 3);
|
48 |
$this->donnees['references'] = array_slice($references, 0, 3);
|
| 52 |
foreach ($this->donnees['references'] as $id=>$reference) {
|
49 |
foreach ($this->donnees['references'] as $id=>$reference) {
|
| 53 |
preg_match('/.*<strong>(.*)<\/strong>.*/', $reference['reference_html'], $titre);
|
50 |
preg_match('/.*<strong>(.*)<\/strong>.*/', $reference['reference_html'], $titre);
|
| 54 |
$this->donnees['references'][$id]['reference_html'] = $titre[1];
|
51 |
$this->donnees['references'][$id]['reference_html'] = $titre[1];
|
| 55 |
}
|
52 |
}
|
| 56 |
$this->donnees['autresReferences'] = count($references) - 3;
|
53 |
$this->donnees['autresReferences'] = count($references) - 3;
|
| 57 |
if ($this->donnees['flores'] == array() && $this->donnees['references'] == array()) {
|
54 |
if ($this->donnees['references'] == array()) {
|
| 58 |
$this->donnees['wikini'] = $this->getWikini();
|
55 |
$this->donnees['wikini'] = $this->getWikini();
|
| 59 |
}
|
56 |
}
|
| 60 |
return $this->donnees;
|
57 |
return $this->donnees;
|
| Line 61... |
Line -... |
| 61 |
}
|
- |
|
| 62 |
|
- |
|
| 63 |
// Récupération des données flores présentes dans le référentiel
|
- |
|
| 64 |
private function getFlores() {
|
- |
|
| 65 |
if (Config::get($this->referentiel.'.baseFloresRef') != "") {
|
- |
|
| 66 |
$flores = $this->nomCourant->getNomRetenu()->get('flores');
|
- |
|
| 67 |
$flores = explode(',', $flores);
|
- |
|
| 68 |
$this->donnees['flores']['liste_flores'] = $this->remplacerCorrespondancesFlores($flores);
|
- |
|
| 69 |
$this->meta->setProjet($this->referentiel);
|
- |
|
| 70 |
$meta = $this->meta->getMetaDonnees();
|
- |
|
| 71 |
$this->donnees['flores']['meta'] = $meta[0];
|
- |
|
| 72 |
$this->donnees['flores']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($this->referentiel);
|
- |
|
| 73 |
}
|
- |
|
| 74 |
}
|
- |
|
| 75 |
|
- |
|
| 76 |
private function getFloresBloc() {
|
- |
|
| 77 |
$flores = $this->nomCourant->getNomRetenu()->get('flores');
|
- |
|
| 78 |
$flores = explode(',', $flores);
|
- |
|
| 79 |
$flores = $this->remplacerCorrespondancesFlores($flores);
|
- |
|
| 80 |
$this->donnees['flores'] = array_slice($flores, 0, 3);
|
- |
|
| Line 81... |
Line 58... |
| 81 |
$this->donnees['autresFlores'] = count($flores) - 3;
|
58 |
}
|
| 82 |
}
|
59 |
|
| 83 |
|
60 |
|
| 84 |
//Obtention des données issues de biblio_bota
|
61 |
//Obtention des données issues de biblio_bota
|
| Line 98... |
Line 75... |
| 98 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
75 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
| 99 |
$wikini['biblio'] = $this->wikini->getTexteFormate($page_wiki, 'biblio');
|
76 |
$wikini['biblio'] = $this->wikini->getTexteFormate($page_wiki, 'biblio');
|
| 100 |
return $wikini;
|
77 |
return $wikini;
|
| 101 |
}
|
78 |
}
|
| Line 102... |
Line -... |
| 102 |
|
- |
|
| 103 |
//TODO: faire une ontologie mais pas de tache prévue dans ce sprint
|
- |
|
| 104 |
private function getCorrespondancesBiblio() {
|
- |
|
| 105 |
$correspondance = array(
|
- |
|
| 106 |
'1' => 'BONNIER & LAYENS, 1894. Tables synoptiques des plantes vasculaires de la flore de France.',
|
- |
|
| 107 |
'2' => 'COSTE, 1899-1906. Flore illustrée France, (3 vol.).',
|
- |
|
| 108 |
'3' => 'FOURNIER, 1934-1940. Quatre Flores de France.',
|
- |
|
| 109 |
'3*' => 'FOURNIER, additions dans l\'édition de 1961.',
|
- |
|
| 110 |
'4' => 'TUTIN & al., 1964-1980. Flora Europaea, (5 vol.).',
|
- |
|
| 111 |
'4*' => 'Flora Europaea, édition 2 (Vol. 1), voir TUTIN & al. (1993), abrégée en FE2. L\'indication est surtout donnée quand la citation n\'a pas été faite dans 4 (supplémentaire ou modifiée).',
|
- |
|
| 112 |
'5' => 'GUINOCHET & VILMORIN, 1973-1984. Flore de France, éd. C.N.R.S., (5 vol.).',
|
- |
|
| 113 |
'6' => 'KERGUÉLEN, 1993. Liste synonymique de la flore de France.'
|
- |
|
| 114 |
);
|
- |
|
| 115 |
return $correspondance;
|
- |
|
| 116 |
}
|
79 |
|
| 117 |
|
- |
|
| 118 |
private function remplacerCorrespondancesFlores($flores) {
|
- |
|
| 119 |
$correspondance_code_flores = $this->getCorrespondancesBiblio();
|
- |
|
| 120 |
$flores_texte = array();
|
80 |
|
| 121 |
|
- |
|
| 122 |
foreach($flores as $code_flore) {
|
- |
|
| 123 |
$code_flore = trim($code_flore);
|
- |
|
| 124 |
if(isset($correspondance_code_flores[$code_flore])) {
|
- |
|
| 125 |
$flores_texte[] = $correspondance_code_flores[$code_flore];
|
- |
|
| 126 |
}
|
- |
|
| 127 |
}
|
- |
|
| 128 |
return $flores_texte;
|
- |
|
| 129 |
}
|
81 |
|
| 130 |
}
|
82 |
}
|
| 131 |
?>
|
83 |
?>
|