Line 18... |
Line 18... |
18 |
private $conteneur;
|
18 |
private $conteneur;
|
19 |
private $nomCourant;
|
19 |
private $nomCourant;
|
20 |
private $meta;
|
20 |
private $meta;
|
21 |
private $appUrls;
|
21 |
private $appUrls;
|
22 |
private $wikini;
|
22 |
private $wikini;
|
- |
|
23 |
private $referentiel = 'bdtfx';
|
- |
|
24 |
private $donnees = array();
|
Line 23... |
Line 25... |
23 |
|
25 |
|
24 |
public function __construct(Conteneur $conteneur) {
|
26 |
public function __construct(Conteneur $conteneur) {
|
25 |
$this->conteneur = $conteneur;
|
27 |
$this->conteneur = $conteneur;
|
- |
|
28 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
26 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
29 |
$this->referentiel = $this->conteneur->getParametre('referentiel');
|
27 |
$this->wikini = $this->conteneur->getApiWikini();
|
30 |
$this->wikini = $this->conteneur->getApiWikini();
|
28 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
31 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
29 |
$this->appUrls = $this->conteneur->getAppUrls();
|
32 |
$this->appUrls = $this->conteneur->getAppUrls();
|
Line 30... |
Line 33... |
30 |
}
|
33 |
}
|
31 |
|
- |
|
32 |
public function obtenirDonnees() {
|
34 |
|
33 |
$donnees['flores']['liste_flores'] = $this->getFlores();
|
- |
|
34 |
$this->meta->setProjet('bdtfx');
|
- |
|
35 |
$meta = $this->meta->getMetaDonnees();
|
- |
|
36 |
$titreMeta = $meta[0]['titre'];
|
- |
|
37 |
$donnees['flores']['meta']['titre'] = $titreMeta;
|
35 |
public function obtenirDonnees() {
|
38 |
$donnees['flores']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx');
|
36 |
$this->getFlores();
|
39 |
|
37 |
|
40 |
$donnees['bibliobota']['references'] = $this->getBiblioBota();
|
38 |
$this->donnees['bibliobota']['references'] = $this->getBiblioBota();
|
41 |
$this->meta->setProjet('bibliobota');
|
39 |
$this->meta->setProjet('bibliobota');
|
42 |
$meta = $this->meta->getMetaDonnees();
|
40 |
$meta = $this->meta->getMetaDonnees();
|
43 |
$titreMeta = $meta[0]['titre'];
|
41 |
$titreMeta = $meta[0]['titre'];
|
- |
|
42 |
$this->donnees['bibliobota']['meta']['titre'] = $titreMeta;
|
44 |
$donnees['bibliobota']['meta']['titre'] = $titreMeta;
|
43 |
$this->donnees['bibliobota']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bibliobota');
|
45 |
$donnees['bibliobota']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bibliobota');
|
44 |
|
46 |
$donnees['wikini'] = $this->getWikini();
|
45 |
$this->donnees['wikini'] = $this->getWikini();
|
Line 47... |
Line 46... |
47 |
return $donnees;
|
46 |
return $this->donnees;
|
48 |
}
|
47 |
}
|
49 |
|
- |
|
50 |
public function getBloc() {
|
- |
|
51 |
$flores = $this->getFlores();
|
48 |
|
52 |
$donnees['flores'] = array_slice($flores, 0, 3);
|
49 |
public function getBloc() {
|
53 |
$donnees['autresFlores'] = count($flores) - 3;
|
50 |
$this->getFloresBloc();
|
54 |
$references = $this->getBiblioBota();
|
51 |
$references = $this->getBiblioBota();
|
55 |
$donnees['references'] = array_slice($references, 0, 3);
|
52 |
$this->donnees['references'] = array_slice($references, 0, 3);
|
56 |
foreach ($donnees['references'] as $id=>$reference) {
|
53 |
foreach ($this->donnees['references'] as $id=>$reference) {
|
57 |
preg_match('/.*<strong>(.*)<\/strong>.*/', $reference['reference_html'], $titre);
|
54 |
preg_match('/.*<strong>(.*)<\/strong>.*/', $reference['reference_html'], $titre);
|
58 |
$donnees['references'][$id]['reference_html'] = $titre[1];
|
55 |
$this->donnees['references'][$id]['reference_html'] = $titre[1];
|
59 |
}
|
56 |
}
|
60 |
$donnees['autresReferences'] = count($references) - 3;
|
57 |
$this->donnees['autresReferences'] = count($references) - 3;
|
61 |
if ($donnees['flores'] == array() && $donnees['references'] == array()) {
|
58 |
if ($this->donnees['flores'] == array() && $this->donnees['references'] == array()) {
|
62 |
$donnees['wikini'] = $this->getWikini();
|
59 |
$this->donnees['wikini'] = $this->getWikini();
|
Line 63... |
Line 60... |
63 |
}
|
60 |
}
|
64 |
return $donnees;
|
61 |
return $this->donnees;
|
- |
|
62 |
}
|
- |
|
63 |
|
- |
|
64 |
// Récupération des données flores présentes dans le référentiel
|
- |
|
65 |
private function getFlores() {
|
- |
|
66 |
if (Config::get($this->referentiel.'.baseFloresRef') != "") {
|
- |
|
67 |
$flores = $this->nomCourant->getNomRetenu()->get('flores');
|
- |
|
68 |
$flores = explode(',', $flores);
|
- |
|
69 |
$this->donnees['flores']['liste_flores'] = $this->remplacerCorrespondancesFlores($flores);
|
- |
|
70 |
$this->meta->setProjet($this->referentiel);
|
- |
|
71 |
$meta = $this->meta->getMetaDonnees();
|
- |
|
72 |
$titreMeta = $meta[0]['titre'];
|
- |
|
73 |
$this->donnees['flores']['meta']['titre'] = $titreMeta;
|
- |
|
74 |
$this->donnees['flores']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($this->referentiel);
|
65 |
}
|
75 |
}
|
66 |
|
76 |
}
|
67 |
// Récupération des données flores présentes dans le référentiel
|
77 |
|
- |
|
78 |
private function getFloresBloc() {
|
- |
|
79 |
$flores = $this->nomCourant->getNomRetenu()->get('flores');
|
68 |
private function getFlores() {
|
80 |
$flores = explode(',', $flores);
|
Line 69... |
Line 81... |
69 |
$flores = $this->nomCourant->getNomRetenu()->get('flores');
|
81 |
$flores = $this->remplacerCorrespondancesFlores($flores);
|
70 |
$flores = explode(',', $flores);
|
82 |
$this->donnees['flores'] = array_slice($flores, 0, 3);
|
71 |
return $this->remplacerCorrespondancesFlores($flores);
|
83 |
$this->donnees['autresFlores'] = count($flores) - 3;
|