| Line 23... |
Line 23... |
| 23 |
static $mois = array(
|
23 |
static $mois = array(
|
| 24 |
'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet',
|
24 |
'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet',
|
| 25 |
'août', 'septembre', 'octobre', 'novembre', 'décembre');
|
25 |
'août', 'septembre', 'octobre', 'novembre', 'décembre');
|
| 26 |
private $CosteFormate;
|
26 |
private $CosteFormate;
|
| 27 |
private $CosteTexte;
|
27 |
private $CosteTexte;
|
| 28 |
|
28 |
|
| 29 |
private $referentiel = 'bdtfx';
|
29 |
private $referentiel = 'bdtfx';
|
| 30 |
private $donnees = array();
|
30 |
private $donnees = array();
|
| Line 31... |
Line 31... |
| 31 |
|
31 |
|
| 32 |
public function __construct(Conteneur $conteneur) {
|
32 |
public function __construct(Conteneur $conteneur) {
|
| Line 46... |
Line 46... |
| 46 |
$this->getWikini();
|
46 |
$this->getWikini();
|
| 47 |
$this->getDescriptionsDependantesReferentiel($this->referentiel);
|
47 |
$this->getDescriptionsDependantesReferentiel($this->referentiel);
|
| 48 |
$this->getCoste();
|
48 |
$this->getCoste();
|
| 49 |
return $this->donnees;
|
49 |
return $this->donnees;
|
| 50 |
}
|
50 |
}
|
| 51 |
|
51 |
|
| 52 |
public function obtenirDonneesExport() {
|
52 |
public function obtenirDonneesExport() {
|
| 53 |
$donnees = array();
|
53 |
$donnees = array();
|
| 54 |
$this->getWikini();
|
54 |
$this->getWikini();
|
| 55 |
$this->getDescriptionsDependantesReferentiel($this->referentiel);
|
55 |
$this->getDescriptionsDependantesReferentiel($this->referentiel);
|
| 56 |
return $this->donnees;
|
56 |
return $this->donnees;
|
| 57 |
}
|
57 |
}
|
| 58 |
|
58 |
|
| 59 |
private function getDescriptionsDependantesReferentiel($ref) {
|
59 |
private function getDescriptionsDependantesReferentiel($ref) {
|
| 60 |
if(trim(Config::get($ref . '.baseDescription')) != "") {
|
60 |
if(trim(Config::get($ref . '.baseDescription')) != "") {
|
| 61 |
// eg: [bdtfx]baseDescription = coste,baseflor dans bdtfx.ini
|
61 |
// eg: [bdtfx]baseDescription = coste,baseflor dans bdtfx.ini
|
| 62 |
$bases_descriptions = explode(',', Config::get($ref . '.baseDescription'));
|
62 |
$bases_descriptions = explode(',', Config::get($ref . '.baseDescription'));
|
| 63 |
foreach ($bases_descriptions as $base) {
|
63 |
foreach ($bases_descriptions as $base) {
|
| 64 |
$fonction = 'get'.ucfirst($base);
|
64 |
$fonction = 'get'.ucfirst($base);
|
| 65 |
$this->$fonction();
|
65 |
$this->$fonction();
|
| 66 |
}
|
66 |
}
|
| 67 |
}
|
67 |
}
|
| 68 |
}
|
68 |
}
|
| 69 |
|
69 |
|
| 70 |
public function getBloc() {
|
70 |
public function getBloc() {
|
| 71 |
// prend la première description disponible dans l'ordre indiqué dans le fichier
|
71 |
// prend la première description disponible dans l'ordre indiqué dans le fichier
|
| 72 |
// de config, et prend la description wiki sinon
|
72 |
// de config, et prend la description wiki sinon
|
| 73 |
if(Config::get($this->referentiel.'.baseDescription') != "") {
|
73 |
if(Config::get($this->referentiel.'.baseDescription') != "") {
|
| 74 |
$bases_descriptions = explode(',', Config::get($this->referentiel.'.baseDescription'));
|
74 |
$bases_descriptions = explode(',', Config::get($this->referentiel.'.baseDescription'));
|
| Line 85... |
Line 85... |
| 85 |
$this->donnees['description'] = $this->donnees[$base]['description'];
|
85 |
$this->donnees['description'] = $this->donnees[$base]['description'];
|
| 86 |
unset($this->donnees[$base]);
|
86 |
unset($this->donnees[$base]);
|
| 87 |
return $this->donnees;
|
87 |
return $this->donnees;
|
| 88 |
}
|
88 |
}
|
| 89 |
}
|
89 |
}
|
| 90 |
|
90 |
|
| 91 |
if (empty($this->donnees['description'])) {
|
91 |
if (empty($this->donnees['description'])) {
|
| 92 |
$this->getWikini();
|
92 |
$this->getWikini();
|
| 93 |
$this->donnees['description'] = $this->donnees['wikini']['description'];
|
93 |
$this->donnees['description'] = $this->donnees['wikini']['description'];
|
| 94 |
$this->donnees['titre'] = "Description collaborative";
|
94 |
$this->donnees['titre'] = "Description collaborative";
|
| 95 |
$this->donnees['type'] = 'wikini';
|
95 |
$this->donnees['type'] = 'wikini';
|
| Line 138... |
Line 138... |
| 138 |
}else { $chaine = "en ".self::$mois[(int)$mois_fleurs];
|
138 |
}else { $chaine = "en ".self::$mois[(int)$mois_fleurs];
|
| 139 |
}
|
139 |
}
|
| 140 |
}
|
140 |
}
|
| 141 |
return $chaine;
|
141 |
return $chaine;
|
| 142 |
}
|
142 |
}
|
| 143 |
|
143 |
|
| 144 |
public function getUrlWikipedia() {
|
144 |
public function getUrlWikipedia() {
|
| 145 |
if(!isset($this->donnees['wp'])) {
|
145 |
if(!isset($this->donnees['wp'])) {
|
| 146 |
$this->getWikipedia();
|
146 |
$this->getWikipedia();
|
| 147 |
}
|
147 |
}
|
| 148 |
return $this->donnees['wp'];
|
148 |
return $this->donnees['wp'];
|
| Line 169... |
Line 169... |
| 169 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
169 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
| 170 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
170 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
| 171 |
$wikini['description'] = $this->wikini->getTexteFormate($page_wiki, 'description');
|
171 |
$wikini['description'] = $this->wikini->getTexteFormate($page_wiki, 'description');
|
| 172 |
$this->donnees['wikini'] = $wikini;
|
172 |
$this->donnees['wikini'] = $wikini;
|
| 173 |
}
|
173 |
}
|
| 174 |
|
174 |
|
| 175 |
public function getLienWikini() {
|
175 |
public function getLienWikini() {
|
| 176 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
176 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
| 177 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
177 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
| 178 |
return $this->wikini->getUrlPageWiki($referentiel, $num_tax);
|
178 |
return $this->wikini->getUrlPageWiki($referentiel, $num_tax);
|
| 179 |
}
|
179 |
}
|
| Line 180... |
Line 180... |
| 180 |
|
180 |
|
| 181 |
private function getCoste() {
|
181 |
private function getCoste() {
|
| 182 |
$coste = array();
|
182 |
$coste = array();
|
| 183 |
$this->textes->setProjet('coste');
|
183 |
$this->textes->setProjet('coste');
|
| 184 |
$this->textes->setId('bdtfx.nn:'.$this->nomCourant->getNnr());
|
184 |
$this->textes->setId('bdtfx.nt:'.$this->nomCourant->getNt());
|
| 185 |
$texte = $this->textes->getTexte();
|
185 |
$texte = $this->textes->getTexte();
|
| 186 |
$texte = array_pop($texte['resultats']);
|
186 |
$texte = array_pop($texte['resultats']);
|
| 187 |
if ($texte) {
|
187 |
if ($texte) {
|
| 188 |
$coste['titre'] = $texte['titre'];
|
188 |
$coste['titre'] = $texte['titre'];
|