1 |
<?php
|
1 |
<?php
|
2 |
// declare(encoding='UTF-8');
|
2 |
// declare(encoding='UTF-8');
|
3 |
/**
|
3 |
/**
|
4 |
* Classe mère du module Liste.
|
4 |
* Classe mère du module Liste.
|
5 |
*
|
5 |
*
|
6 |
* @category PHP 5.2
|
6 |
* @category PHP 5.2
|
7 |
* @package eflore-consultation
|
7 |
* @package eflore-consultation
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
9 |
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
|
9 |
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
|
10 |
* @copyright 2011 Tela-Botanica
|
10 |
* @copyright 2011 Tela-Botanica
|
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 Description extends aControleur {
|
15 |
class Description extends aControleur {
|
16 |
|
16 |
|
17 |
private $conteneur = null;
|
17 |
private $conteneur = null;
|
18 |
private $nomCourant = null;
|
18 |
private $nomCourant = null;
|
19 |
private $textes = null;
|
19 |
private $textes = null;
|
20 |
private $meta = null;
|
20 |
private $meta = null;
|
21 |
private $wikini = null;
|
21 |
private $wikini = null;
|
22 |
private $informations = null;
|
22 |
private $informations = null;
|
23 |
private $mois = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août',
|
23 |
private $mois = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août',
|
24 |
'septembre', 'octobre', 'novembre', 'décembre');
|
24 |
'septembre', 'octobre', 'novembre', 'décembre');
|
25 |
private $CosteFormate;
|
25 |
private $CosteFormate;
|
26 |
private $CosteTexte;
|
26 |
private $CosteTexte;
|
27 |
|
27 |
|
28 |
private $referentiel = 'bdtfx';
|
28 |
private $referentiel = 'bdtfx';
|
29 |
private $donnees = array();
|
29 |
private $donnees = array();
|
30 |
|
30 |
|
31 |
public function __construct(Conteneur $conteneur) {
|
31 |
public function __construct(Conteneur $conteneur) {
|
32 |
$this->conteneur = $conteneur;
|
32 |
$this->conteneur = $conteneur;
|
33 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
33 |
$this->nomCourant = $this->conteneur->getNomCourant();
|
34 |
$this->referentiel = $this->conteneur->getParametre('referentiel');
|
34 |
$this->referentiel = $this->conteneur->getParametre('referentiel');
|
35 |
$this->textes = $this->conteneur->getApiTextes();
|
35 |
$this->textes = $this->conteneur->getApiTextes();
|
36 |
$this->wikini = $this->conteneur->getApiWikini();
|
36 |
$this->wikini = $this->conteneur->getApiWikini();
|
37 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
37 |
$this->meta = $this->conteneur->getApiMetaDonnees();
|
38 |
$this->informations = $this->conteneur->getApiInformations();
|
38 |
$this->informations = $this->conteneur->getApiInformations();
|
39 |
$this->appUrls = $this->conteneur->getAppUrls();
|
39 |
$this->appUrls = $this->conteneur->getAppUrls();
|
40 |
}
|
40 |
}
|
41 |
|
41 |
|
42 |
public function obtenirDonnees() {
|
42 |
public function obtenirDonnees() {
|
43 |
$donnees = array();
|
43 |
$donnees = array();
|
44 |
$this->getWikipedia();
|
44 |
$this->getWikipedia();
|
45 |
$this->getWikini();
|
45 |
$this->getWikini();
|
46 |
$this->getDescriptionsDependantesReferentiel();
|
46 |
$this->getDescriptionsDependantesReferentiel();
|
47 |
return $this->donnees;
|
47 |
return $this->donnees;
|
48 |
}
|
48 |
}
|
49 |
|
49 |
|
50 |
public function obtenirDonneesExport() {
|
50 |
public function obtenirDonneesExport() {
|
51 |
$donnees = array();
|
51 |
$donnees = array();
|
52 |
$this->getWikini();
|
52 |
$this->getWikini();
|
53 |
$this->getDescriptionsDependantesReferentiel();
|
53 |
$this->getDescriptionsDependantesReferentiel();
|
54 |
return $this->donnees;
|
54 |
return $this->donnees;
|
55 |
}
|
55 |
}
|
56 |
|
56 |
|
57 |
private function getDescriptionsDependantesReferentiel() {
|
57 |
private function getDescriptionsDependantesReferentiel() {
|
58 |
$bases_descriptions = Config::get($this->referentiel.'.baseDescription');
|
58 |
$bases_descriptions = Config::get($this->referentiel.'.baseDescription');
|
59 |
$bases_descriptions = explode(',',$bases_descriptions);
|
59 |
$bases_descriptions = explode(',',$bases_descriptions);
|
60 |
|
60 |
|
61 |
foreach ($bases_descriptions as $base) {
|
61 |
foreach ($bases_descriptions as $base) {
|
62 |
if($this->aMethodeDescription($base)) {
|
62 |
if($this->aMethodeDescription($base)) {
|
63 |
$fonction = 'get'.ucfirst($base);
|
63 |
$fonction = 'get'.ucfirst($base);
|
64 |
$this->$fonction();
|
64 |
$this->$fonction();
|
65 |
}
|
65 |
}
|
66 |
}
|
66 |
}
|
67 |
}
|
67 |
}
|
68 |
|
68 |
|
69 |
private function aMethodeDescription($base) {
|
69 |
private function aMethodeDescription($base) {
|
70 |
return method_exists($this, 'get'.$base);
|
70 |
return method_exists($this, 'get'.$base);
|
71 |
}
|
71 |
}
|
- |
|
72 |
|
- |
|
73 |
public function getBloc() {
|
- |
|
74 |
// prend la première description disponible dans l'ordre indiqué dans le fichier
|
- |
|
75 |
// de config, et prend la description wiki sinon
|
- |
|
76 |
if(Config::get($this->referentiel.'.baseDescription') != "") {
|
- |
|
77 |
$bases_descriptions = Config::get($this->referentiel.'.baseDescription');
|
- |
|
78 |
$bases_descriptions = explode(',',$bases_descriptions);
|
- |
|
79 |
foreach($bases_descriptions as $base) {
|
- |
|
80 |
if($this->aMethodeDescription($base)) {
|
- |
|
81 |
$fonction = 'get'.ucfirst($base);
|
- |
|
82 |
$this->$fonction();
|
- |
|
83 |
if(!empty($this->donnees[$base]['description'])) {
|
- |
|
84 |
$this->donnees['titre'] = "Description de ".ucfirst($base);
|
- |
|
85 |
$this->donnees['description'] = $this->donnees[$base]['description'];
|
- |
|
86 |
break;
|
- |
|
87 |
}
|
- |
|
88 |
}
|
- |
|
89 |
}
|
- |
|
90 |
}
|
- |
|
91 |
|
- |
|
92 |
if (empty($this->donnees['description'])) {
|
- |
|
93 |
$description = $this->getWikini();
|
- |
|
94 |
$this->donnees['description'] = $description['description'];
|
- |
|
95 |
$this->donnees['titre'] = "Description collaborative";
|
- |
|
96 |
}
|
- |
|
97 |
|
- |
|
98 |
return $this->donnees;
|
- |
|
99 |
}
|
72 |
|
100 |
|
73 |
private function getBaseflor() {
|
101 |
private function getBaseflor() {
|
74 |
$baseflor = array();
|
102 |
$baseflor = array();
|
75 |
$this->informations ->setProjet('baseflor');
|
103 |
$this->informations ->setProjet('baseflor');
|
76 |
$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
|
104 |
$this->informations ->setBdnt($this->conteneur->getParametre('referentiel'));
|
77 |
$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
|
105 |
$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom'));
|
78 |
$informations = $this->informations->getInformationsDescription();
|
106 |
$informations = $this->informations->getInformationsDescription();
|
79 |
if ($informations){
|
107 |
if ($informations){
|
80 |
$baseflor['chorologie'] = isset($informations['chorologie']) ? $informations['chorologie'] : '';
|
108 |
$baseflor['chorologie'] = isset($informations['chorologie']) ? $informations['chorologie'] : '';
|
81 |
$baseflor['inflorescence'] = isset($informations['inflorescence']) ? $informations['inflorescence'] : '';
|
109 |
$baseflor['inflorescence'] = isset($informations['inflorescence']) ? $informations['inflorescence'] : '';
|
82 |
$baseflor['sexualite'] = isset($informations['sexualite']) ? $informations['sexualite'] : '';
|
110 |
$baseflor['sexualite'] = isset($informations['sexualite']) ? $informations['sexualite'] : '';
|
83 |
$baseflor['ordre_maturation'] = isset($informations['ordre_maturation']) ? $informations['ordre_maturation'] : '';
|
111 |
$baseflor['ordre_maturation'] = isset($informations['ordre_maturation']) ? $informations['ordre_maturation'] : '';
|
84 |
$baseflor['pollinisation'] = isset($informations['pollinisation']) ? $informations['pollinisation'] : '';
|
112 |
$baseflor['pollinisation'] = isset($informations['pollinisation']) ? $informations['pollinisation'] : '';
|
85 |
$baseflor['dissemination'] = isset($informations['dissemination']) ? $informations['dissemination'] : '';
|
113 |
$baseflor['dissemination'] = isset($informations['dissemination']) ? $informations['dissemination'] : '';
|
86 |
$baseflor['fruit'] = isset($informations['fruit']) ? $informations['fruit'] : '';
|
114 |
$baseflor['fruit'] = isset($informations['fruit']) ? $informations['fruit'] : '';
|
87 |
$baseflor['couleur_fleur'] = isset($informations['couleur_fleur']) ? $informations['couleur_fleur'] : '';
|
115 |
$baseflor['couleur_fleur'] = isset($informations['couleur_fleur']) ? $informations['couleur_fleur'] : '';
|
88 |
$baseflor['macule'] = isset($informations['macule']) ? $informations['macule'] : '';
|
116 |
$baseflor['macule'] = isset($informations['macule']) ? $informations['macule'] : '';
|
89 |
$baseflor['floraison'] = isset($informations['floraison']) ? $this->changerFloraisonEnChaine($informations['floraison']) : '';
|
117 |
$baseflor['floraison'] = isset($informations['floraison']) ? $this->changerFloraisonEnChaine($informations['floraison']) : '';
|
90 |
//récupérer dans ontologies
|
118 |
//récupérer dans ontologies
|
91 |
$baseflor['type_bio'] = isset($informations['type_bio']) ? $informations['type_bio'] : '';
|
119 |
$baseflor['type_bio'] = isset($informations['type_bio']) ? $informations['type_bio'] : '';
|
92 |
$baseflor['form_vegetale'] = isset($informations['form_vegetale']) ? $informations['form_vegetale'] : '';
|
120 |
$baseflor['form_vegetale'] = isset($informations['form_vegetale']) ? $informations['form_vegetale'] : '';
|
93 |
$baseflor['description']=$baseflor;
|
121 |
$baseflor['description']=$baseflor;
|
94 |
$this->meta->setProjet('baseflor');
|
122 |
$this->meta->setProjet('baseflor');
|
95 |
$meta = $this->meta->getMetaDonnees();
|
123 |
$meta = $this->meta->getMetaDonnees();
|
96 |
$citation = $meta[0]['citation'];
|
124 |
$citation = $meta[0]['citation'];
|
97 |
$baseflor['meta']['citation'] = $citation;
|
125 |
$baseflor['meta']['citation'] = $citation;
|
98 |
$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
|
126 |
$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor');
|
99 |
}
|
127 |
}
|
100 |
$this->donnees['baseflor'] = $baseflor;
|
128 |
$this->donnees['baseflor'] = $baseflor;
|
101 |
}
|
129 |
}
|
102 |
|
130 |
|
103 |
public function changerFloraisonEnChaine($floraison){
|
131 |
public function changerFloraisonEnChaine($floraison){
|
104 |
$chaine = "";
|
132 |
$chaine = "";
|
105 |
if ($floraison != ""){
|
133 |
if ($floraison != ""){
|
106 |
$mois_fleurs=preg_match('/-/',$floraison) ? preg_split('/-/',$floraison) : $floraison;
|
134 |
$mois_fleurs=preg_match('/-/',$floraison) ? preg_split('/-/',$floraison) : $floraison;
|
107 |
if (is_array($mois_fleurs)){
|
135 |
if (is_array($mois_fleurs)){
|
108 |
$chaine = "de ".$this->mois[(int)$mois_fleurs[0]]." à ".$this->mois[(int)$mois_fleurs[1]];
|
136 |
$chaine = "de ".$this->mois[(int)$mois_fleurs[0]]." à ".$this->mois[(int)$mois_fleurs[1]];
|
109 |
|
137 |
|
110 |
}else { $chaine = "en ".$this->mois[(int)$mois_fleurs];
|
138 |
}else { $chaine = "en ".$this->mois[(int)$mois_fleurs];
|
111 |
}
|
139 |
}
|
112 |
}
|
140 |
}
|
113 |
return $chaine;
|
141 |
return $chaine;
|
114 |
}
|
142 |
}
|
115 |
|
- |
|
116 |
|
- |
|
117 |
public function getBloc() {
|
- |
|
118 |
$description = $this->getCoste();
|
- |
|
119 |
$donnees['titre'] = "Description de Coste";
|
- |
|
120 |
if (empty($description['description'])) {
|
- |
|
121 |
$description = $this->getBaseflor(false);
|
- |
|
122 |
$donnees['titre'] = "Description Baseflor";
|
- |
|
123 |
}
|
- |
|
124 |
if (empty($description['description'])) {
|
- |
|
125 |
$description = $this->getWikini();
|
- |
|
126 |
$donnees['titre'] = "Description collaborative";
|
- |
|
127 |
}
|
- |
|
128 |
$donnees['description'] = $description['description'];
|
- |
|
129 |
return $donnees;
|
- |
|
130 |
}
|
- |
|
131 |
|
143 |
|
132 |
public function getWikipedia() {
|
144 |
public function getWikipedia() {
|
133 |
$wp = array();
|
145 |
$wp = array();
|
134 |
$this->textes->setProjet('wikipedia');
|
146 |
$this->textes->setProjet('wikipedia');
|
135 |
$this->textes->setId($this->getIdWp());
|
147 |
$this->textes->setId($this->getIdWp());
|
136 |
$wp['titre'] = $donnees['titre'] = "Description de wikipedia";
|
148 |
$wp['titre'] = $donnees['titre'] = "Description de wikipedia";
|
137 |
$wp['lien'] = $this->textes->getPageUrl();
|
149 |
$wp['lien'] = $this->textes->getPageUrl();
|
138 |
$wp['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('wikipedia');
|
150 |
$wp['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('wikipedia');
|
139 |
$this->donnees['wp'] = $wp;
|
151 |
$this->donnees['wp'] = $wp;
|
140 |
}
|
152 |
}
|
141 |
|
153 |
|
142 |
private function getIdWp() {
|
154 |
private function getIdWp() {
|
143 |
$nomSci = $this->nomCourant->getNomRetenu()->get('nom_sci');
|
155 |
$nomSci = $this->nomCourant->getNomRetenu()->get('nom_sci');
|
144 |
$idWp = str_replace(' ', '_', $nomSci);
|
156 |
$idWp = str_replace(' ', '_', $nomSci);
|
145 |
$idWp = urlencode($idWp);
|
157 |
$idWp = urlencode($idWp);
|
146 |
return $idWp;
|
158 |
return $idWp;
|
147 |
}
|
159 |
}
|
148 |
|
160 |
|
149 |
private function getWikini() {
|
161 |
private function getWikini() {
|
150 |
$wikini = array();
|
162 |
$wikini = array();
|
151 |
$wikini['titre'] = 'Wikini';
|
163 |
$wikini['titre'] = 'Wikini';
|
152 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
164 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
153 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
165 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
154 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
166 |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
|
155 |
$wikini['description'] = $this->wikini->getTexteFormate($page_wiki, 'description');
|
167 |
$wikini['description'] = $this->wikini->getTexteFormate($page_wiki, 'description');
|
156 |
$this->donnees['wikini'] = $wikini;
|
168 |
$this->donnees['wikini'] = $wikini;
|
157 |
}
|
169 |
}
|
158 |
|
170 |
|
159 |
public function getLienWikini() {
|
171 |
public function getLienWikini() {
|
160 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
172 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
161 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
173 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
|
162 |
return $this->wikini->getUrlPageWiki($referentiel, $num_tax);
|
174 |
return $this->wikini->getUrlPageWiki($referentiel, $num_tax);
|
163 |
}
|
175 |
}
|
164 |
|
176 |
|
165 |
private function getCoste() {
|
177 |
private function getCoste() {
|
166 |
$coste = array();
|
178 |
$coste = array();
|
167 |
$this->textes->setProjet('coste');
|
179 |
$this->textes->setProjet('coste');
|
168 |
$this->textes->setId('bdtfx.nn:'.$this->nomCourant->getNnr());
|
180 |
$this->textes->setId('bdtfx.nn:'.$this->nomCourant->getNnr());
|
169 |
$texte = $this->textes->getTexte();
|
181 |
$texte = $this->textes->getTexte();
|
170 |
if ($texte) {
|
182 |
if ($texte) {
|
171 |
$coste['titre'] = $texte['titre'];
|
183 |
$coste['titre'] = $texte['titre'];
|
172 |
$coste['description'] = $this->mettreEnFormeCoste($texte['texte']);
|
184 |
$coste['description'] = $this->mettreEnFormeCoste($texte['texte']);
|
173 |
}
|
185 |
}
|
174 |
$this->meta->setProjet('coste');
|
186 |
$this->meta->setProjet('coste');
|
175 |
$meta = $this->meta->getMetaDonnees();
|
187 |
$meta = $this->meta->getMetaDonnees();
|
176 |
$citation = $meta[0]['citation'];
|
188 |
$citation = $meta[0]['citation'];
|
177 |
$coste['meta']['citation'] = $citation;
|
189 |
$coste['meta']['citation'] = $citation;
|
178 |
$coste['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('coste');
|
190 |
$coste['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('coste');
|
179 |
$this->donnees['coste'] = $coste;
|
191 |
$this->donnees['coste'] = $coste;
|
180 |
}
|
192 |
}
|
181 |
|
193 |
|
182 |
public function mettreEnFormeCoste($texte){
|
194 |
public function mettreEnFormeCoste($texte){
|
183 |
$this->CosteFormate = array();
|
195 |
$this->CosteFormate = array();
|
184 |
$this->CosteTexte = $texte;
|
196 |
$this->CosteTexte = $texte;
|
185 |
//decouper elements remarquables avant le texte
|
197 |
//decouper elements remarquables avant le texte
|
186 |
$this->separerNomScientifique_a_NomCommun();
|
198 |
$this->separerNomScientifique_a_NomCommun();
|
187 |
$this->CosteTexte = preg_replace('/\//','',$this->CosteTexte);
|
199 |
$this->CosteTexte = preg_replace('/\//','',$this->CosteTexte);
|
188 |
//decouper elements remarquables après le texte
|
200 |
//decouper elements remarquables après le texte
|
189 |
$this-> separerEcologie_a_Usages();
|
201 |
$this-> separerEcologie_a_Usages();
|
190 |
//le morceau qui reste est le gros de la description
|
202 |
//le morceau qui reste est le gros de la description
|
191 |
$this->CosteTexte = str_replace(';','</br> -','- '.$this->CosteTexte);
|
203 |
$this->CosteTexte = str_replace(';','</br> -','- '.$this->CosteTexte);
|
192 |
$this->CosteTexte = str_replace('–','',$this->CosteTexte);
|
204 |
$this->CosteTexte = str_replace('–','',$this->CosteTexte);
|
193 |
$this->CosteFormate['texte'] = $this->CosteTexte;
|
205 |
$this->CosteFormate['texte'] = $this->CosteTexte;
|
194 |
return $this->CosteFormate;
|
206 |
return $this->CosteFormate;
|
195 |
}
|
207 |
}
|
196 |
|
208 |
|
197 |
|
209 |
|
198 |
public function separerNomScientifique_a_NomCommun(){
|
210 |
public function separerNomScientifique_a_NomCommun(){
|
199 |
if ( preg_match('/\*\*(.+)\*\*([^–]*)–/', $this->CosteTexte, $retour)){
|
211 |
if ( preg_match('/\*\*(.+)\*\*([^–]*)–/', $this->CosteTexte, $retour)){
|
200 |
/* !! attention on enlève un tiret cadratin – pas un trait d'union - !! */
|
212 |
/* !! attention on enlève un tiret cadratin – pas un trait d'union - !! */
|
201 |
$a_enlever = array('/–/','/\./' );
|
213 |
$a_enlever = array('/–/','/\./' );
|
202 |
$this->CosteFormate['nom_scientifique'] = preg_replace($a_enlever,'',$retour[1]);
|
214 |
$this->CosteFormate['nom_scientifique'] = preg_replace($a_enlever,'',$retour[1]);
|
203 |
if(preg_match('/\((.+)\)/',$retour[2],$synonymes)){
|
215 |
if(preg_match('/\((.+)\)/',$retour[2],$synonymes)){
|
204 |
$this->CosteFormate['synonymes'] = $synonymes[1];
|
216 |
$this->CosteFormate['synonymes'] = $synonymes[1];
|
205 |
} else {
|
217 |
} else {
|
206 |
$this->CosteFormate['nom_scientifique'] .= $retour[2];
|
218 |
$this->CosteFormate['nom_scientifique'] .= $retour[2];
|
207 |
}
|
219 |
}
|
208 |
$this->CosteTexte = str_replace($retour[0],'',$this->CosteTexte);
|
220 |
$this->CosteTexte = str_replace($retour[0],'',$this->CosteTexte);
|
209 |
}
|
221 |
}
|
210 |
/* !! attention il y a un espace avant les // du début !! */
|
222 |
/* !! attention il y a un espace avant les // du début !! */
|
211 |
if ( preg_match('/^ \/\/([^\/\/]+)\/\//', $this->CosteTexte, $retour)){
|
223 |
if ( preg_match('/^ \/\/([^\/\/]+)\/\//', $this->CosteTexte, $retour)){
|
212 |
$a_enlever = array('/–/','/\./' );
|
224 |
$a_enlever = array('/–/','/\./' );
|
213 |
$this->CosteFormate['nom_commun'] = preg_replace($a_enlever,'',$retour[1]);
|
225 |
$this->CosteFormate['nom_commun'] = preg_replace($a_enlever,'',$retour[1]);
|
214 |
$this->CosteTexte = str_replace($retour[0],'',$this->CosteTexte);
|
226 |
$this->CosteTexte = str_replace($retour[0],'',$this->CosteTexte);
|
215 |
}
|
227 |
}
|
216 |
}
|
228 |
}
|
217 |
|
229 |
|
218 |
|
230 |
|
219 |
public function separerEcologie_a_Usages(){
|
231 |
public function separerEcologie_a_Usages(){
|
220 |
if ( preg_match('/\.[ ]*([A-ZÉÀÈ].+)$/',$this->CosteTexte, $retour)){
|
232 |
if ( preg_match('/\.[ ]*([A-ZÉÀÈ].+)$/',$this->CosteTexte, $retour)){
|
221 |
$this->CosteFormate['ecologie'] = $retour[1];
|
233 |
$this->CosteFormate['ecologie'] = $retour[1];
|
222 |
$this->CosteTexte = str_replace($retour[0],'.',$this->CosteTexte);
|
234 |
$this->CosteTexte = str_replace($retour[0],'.',$this->CosteTexte);
|
223 |
if (isset($this->CosteFormate['ecologie']) && preg_match('/–(.+)/', $this->CosteFormate['ecologie'] , $retour)){
|
235 |
if (isset($this->CosteFormate['ecologie']) && preg_match('/–(.+)/', $this->CosteFormate['ecologie'] , $retour)){
|
224 |
$this->CosteFormate['repartition'] = $retour[1];
|
236 |
$this->CosteFormate['repartition'] = $retour[1];
|
225 |
$this->CosteFormate['ecologie'] = str_replace($retour[0],'',$this->CosteFormate['ecologie']);
|
237 |
$this->CosteFormate['ecologie'] = str_replace($retour[0],'',$this->CosteFormate['ecologie']);
|
226 |
}
|
238 |
}
|
227 |
if (isset($this->CosteFormate['repartition']) && preg_match('/=(.+)$/', $this->CosteFormate['repartition'], $retour)){
|
239 |
if (isset($this->CosteFormate['repartition']) && preg_match('/=(.+)$/', $this->CosteFormate['repartition'], $retour)){
|
228 |
$this->CosteFormate['floraison'] = $retour[1];
|
240 |
$this->CosteFormate['floraison'] = $retour[1];
|
229 |
$this->CosteFormate['repartition'] = str_replace($retour[0],'',$this->CosteFormate['repartition']);
|
241 |
$this->CosteFormate['repartition'] = str_replace($retour[0],'',$this->CosteFormate['repartition']);
|
230 |
}
|
242 |
}
|
231 |
if (isset($this->CosteFormate['floraison']) && preg_match('/–(.+)$|\n(.+)$/',$this->CosteFormate['floraison'], $retour)){
|
243 |
if (isset($this->CosteFormate['floraison']) && preg_match('/–(.+)$|\n(.+)$/',$this->CosteFormate['floraison'], $retour)){
|
232 |
$this->CosteFormate['usages'] = isset($retour[1]) ? $retour[1] : $retour[2];
|
244 |
$this->CosteFormate['usages'] = isset($retour[1]) ? $retour[1] : $retour[2];
|
233 |
$this->CosteFormate['floraison'] = str_replace($retour[0],'.',$this->CosteFormate['floraison']);
|
245 |
$this->CosteFormate['floraison'] = str_replace($retour[0],'.',$this->CosteFormate['floraison']);
|
234 |
}
|
246 |
}
|
235 |
if (isset($this->CosteFormate['floraison']) && preg_match('/([Ff]l\.) (.+)/',$this->CosteFormate['floraison'], $retour)){
|
247 |
if (isset($this->CosteFormate['floraison']) && preg_match('/([Ff]l\.) (.+)/',$this->CosteFormate['floraison'], $retour)){
|
236 |
$this->CosteFormate['floraison'] = $retour[2];
|
248 |
$this->CosteFormate['floraison'] = $retour[2];
|
237 |
$this->CosteFormate['floraison'] = str_replace($retour[1],'',$this->CosteFormate['floraison']);
|
249 |
$this->CosteFormate['floraison'] = str_replace($retour[1],'',$this->CosteFormate['floraison']);
|
238 |
}
|
250 |
}
|
239 |
if (isset($this->CosteFormate['floraison']) && preg_match('/([Ff]r\.) (.+)/',$this->CosteFormate['floraison'], $retour)){
|
251 |
if (isset($this->CosteFormate['floraison']) && preg_match('/([Ff]r\.) (.+)/',$this->CosteFormate['floraison'], $retour)){
|
240 |
$this->CosteFormate['fructification'] = $retour[2];
|
252 |
$this->CosteFormate['fructification'] = $retour[2];
|
241 |
$this->CosteFormate['floraison'] = str_replace($retour[0],'',$this->CosteFormate['floraison']);
|
253 |
$this->CosteFormate['floraison'] = str_replace($retour[0],'',$this->CosteFormate['floraison']);
|
242 |
$this->CosteFormate['floraison'] = str_replace(',','',$this->CosteFormate['floraison']);
|
254 |
$this->CosteFormate['floraison'] = str_replace(',','',$this->CosteFormate['floraison']);
|
243 |
$this->CosteFormate['fructification'] = str_replace($retour[1],'',$this->CosteFormate['fructification']);
|
255 |
$this->CosteFormate['fructification'] = str_replace($retour[1],'',$this->CosteFormate['fructification']);
|
244 |
$this->CosteFormate['fructification'] = str_replace('.','',$this->CosteFormate['fructification']);
|
256 |
$this->CosteFormate['fructification'] = str_replace('.','',$this->CosteFormate['fructification']);
|
245 |
}
|
257 |
}
|
246 |
}
|
258 |
}
|
247 |
}
|
259 |
}
|
248 |
|
- |
|
249 |
|
- |
|
250 |
}
|
260 |
}
|
251 |
?>
|
261 |
?>
|