Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 352 | Rev 485 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 352 Rev 353
1
<?php
1
<?php
2
class GenerateurNomSciHtml {
2
class GenerateurNomSciHtml {
3
	protected $bdd = null;
3
	protected $bdd = null;
4
	protected $table = null;
4
	protected $table = null;
5
 
5
 
6
	protected $num = null;
6
	protected $num = null;
7
	protected $compo_nom = array();
7
	protected $compo_nom = array();
8
 
8
 
9
	protected $abbr = array (
9
	protected $abbr = array (
10
			'infra-gen.' 	=>	'Infra-Genre',
10
			'infra-gen.' 	=>	'Infra-Genre',
11
			'sect.'			=> 'Section',
11
			'sect.'			=> 'Section',
12
			'subsect.'		=> 'Sous-Section',
12
			'subsect.'		=> 'Sous-Section',
13
			'ser.'			=> 'Série',
13
			'ser.'			=> 'Série',
14
			'subser.'		=> 'Sous-Série',
14
			'subser.'		=> 'Sous-Série',
15
			'gr.'			=> 'Groupe',
15
			'gr.'			=> 'Groupe',
16
			'agg.' 			=> 'Agrégat',
16
			'agg.' 			=> 'Agrégat',
17
			'sp.' 			=> 'Espèce',
17
			'sp.' 			=> 'Espèce',
18
			'subsp.'		=> 'Sous-Espèce',
18
			'subsp.'		=> 'Sous-Espèce',
19
			'infra-sp.'		=> 'Infra-Espèce',
19
			'infra-sp.'		=> 'Infra-Espèce',
20
			'var.'			=> 'Variété',
20
			'var.'			=> 'Variété',
21
			'subvar.'		=> 'Sous-Variété',
21
			'subvar.'		=> 'Sous-Variété',
22
			'fa'			=> 'Forme',
22
			'fa'			=> 'Forme',
23
			'subf.'			=> 'Sous-Forme',
23
			'subf.'			=> 'Sous-Forme',
24
			'f. sp.'		=> 'Forma species',
24
			'f. sp.'		=> 'Forma species',
25
			'proles' 		=> 'Race prole'
25
			'proles' 		=> 'Race prole'
26
	);
26
	);
27
 
27
 
28
	private $nomSciTpl = '<span class="sci">%s</span>';
28
	private $nomSciTpl = '<span class="sci">%s</span>';
-
 
29
 
29
	private $nomSupraGenTpl = '<span class="supra_gen">%s</span>';
30
	private $nomSupraGenTpl = '<span class="supra_gen">%s</span>';
30
	private $genTpl = '<span class="gen">%s</span>';
31
	private $genTpl = '<span class="gen">%s</span>';
31
	private $infraGenTpl = '<span class="infra-gen">%s</span>';
32
	private $infraGenTpl = '<span class="infra-gen">%s</span>';
32
	private $spFHTpl = '<span class="gen">%s</span> <span class="sp">%s</span>';
33
	private $spFHTpl = '<span class="gen">%s</span> <span class="sp">%s</span>';
33
	private $typeEpitheteTpl = '<abbr class="type_epithete" title="%s">%s</abbr>';
34
	private $typeEpitheteTpl = '<abbr class="type_epithete" title="%s">%s</abbr>';
34
	private $infraSpFHTpl = '<span class="gen">%s</span> <span class="sp">%s</span> <abbr class="type-epithete" title="%s">%s</abbr> <span class="infra-sp">%s</span>';
35
	private $infraSpFHTpl = '<span class="gen">%s</span> <span class="sp">%s</span> <abbr class="type-epithete" title="%s">%s</abbr> <span class="infra-sp">%s</span>';
-
 
36
 
-
 
37
	private $hybrideTpl = '<span class="hyb">× <span class="%s">%s</span></span>';
-
 
38
	private $chimereTpl = '<span class="chimere">+ <span class="%s">%s</span></span>';
35
	private $formuleHybTpl = '<span class="formule-hyb">%s</span>';
39
	private $formuleHybTpl = '<span class="formule-hyb">%s</span>';
-
 
40
	private $hybriditeTpl = '<span class="%s">%s</span>';
-
 
41
 
-
 
42
	private $gpGxAvecCvarTpl = '<span class="gp">%s <abbr title="grex">gx</abbr>(%s <abbr title="groupe">Gp</abbr>)</span>';
-
 
43
	private $gpGxSansCvarTpl = '<span class="gp">%s <abbr title="grex">gx</abbr>%s <abbr title="groupe">Gp</abbr></span>';
-
 
44
	private $gxTpl = '<span class="gp">%s <abbr title="grex">gx</abbr></span>';
-
 
45
	private $gpAvecCvarTpl = '<span class="gp">(%s <abbr title="groupe">Gp</abbr>)</span>';
-
 
46
	private $gpSansCvarTpl = '<span class="gp">%s <abbr title="groupe">Gp</abbr></span>';
-
 
47
	private $commTpl = '<span class="commercial">%s</span>';
-
 
48
	private $cvarTpl = '<span class="cultivar">\'%s\'</span>';
36
 
49
 
37
	public function generer(Array $nomsDecomposes) {
50
	public function generer(Array $nomsDecomposes) {
38
		$nomsSciHtml = array();
51
		$nomsSciHtml = array();
39
		foreach ($nomsDecomposes as $infos) {
52
		foreach ($nomsDecomposes as $infos) {
40
			$this->initialiserVariables($infos);
53
			$this->initialiserVariables($infos);
41
 
54
 
42
			$nomSciHtml = '';
55
			$nomSciHtml = '';
43
			$nomSciHtml .= $this->ajouterBaliseNomSupraGen();
56
			$nomSciHtml .= $this->ajouterBaliseNomSupraGen();
44
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['genre'], 'gen');
57
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['genre'], 'gen');
45
			$nomSciHtml .= $this->ajouterBaliseInfraGen();
58
			$nomSciHtml .= $this->ajouterBaliseInfraGen();
46
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_sp'], 'sp');
59
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_sp'], 'sp');
47
			$nomSciHtml .= $this->ajouterBaliseTypeInfraSp();
60
			$nomSciHtml .= $this->ajouterBaliseTypeInfraSp();
48
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_infra_sp'], 'infra-sp');
61
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_infra_sp'], 'infra-sp');
49
			$nomSciHtml .= $this->ajouterCultivarGpComm();
62
			$nomSciHtml .= $this->ajouterCultivarGpComm();
50
 
63
 
51
			if ($nomSciHtml != '') {
64
			if ($nomSciHtml != '') {
52
				$nomsSciHtml[$this->num] = sprintf($this->nomSciTpl, trim($nomSciHtml));
65
				$nomsSciHtml[$this->num] = sprintf($this->nomSciTpl, trim($nomSciHtml));
53
			}
66
			}
54
		}
67
		}
55
		return $nomsSciHtml;
68
		return $nomsSciHtml;
56
	}
69
	}
57
 
70
 
58
	private function initialiserVariables($infos) {
71
	private function initialiserVariables($infos) {
59
		$this->num = $infos['num_nom'];
72
		$this->num = $infos['num_nom'];
60
		$this->compo_nom = $infos;
73
		$this->compo_nom = $infos;
61
	}
74
	}
62
 
75
 
63
	private function ajouterBaliseNomSupraGen() {
76
	private function ajouterBaliseNomSupraGen() {
64
		$html = '';
77
		$html = '';
65
		if ($this->compo_nom['nom_supra_generique'] != '') {
78
		if ($this->compo_nom['nom_supra_generique'] != '') {
66
			$html = sprintf($this->nomSupraGenTpl, $this->compo_nom['nom_supra_generique']);
79
			$html = sprintf($this->nomSupraGenTpl, $this->compo_nom['nom_supra_generique']);
67
		}
80
		}
68
		return $html;
81
		return $html;
69
	}
82
	}
70
 
83
 
71
	private function ajouterTypeEpithete($type) {
84
	private function ajouterTypeEpithete($type) {
72
		if (!array_key_exists($type, $this->abbr)) {
85
		if (!array_key_exists($type, $this->abbr)) {
73
			$this->abbr[$type] = $type;
86
			$this->abbr[$type] = $type;
74
		}
87
		}
75
	}
88
	}
76
 
89
 
77
	private function ajouterBaliseInfraGen() {
90
	private function ajouterBaliseInfraGen() {
78
		$html = '';
91
		$html = '';
79
		if ($this->verifierTypeInfraGen()) {
92
		if ($this->verifierTypeInfraGen()) {
80
			$html .= $this->ajouterBaliseTypeInfraGen();
93
			$html .= $this->ajouterBaliseTypeInfraGen();
81
		} else {
94
		} else {
82
			if ($this->avoirInfo('epithete_infra_generique')) {
95
			if ($this->avoirInfo('epithete_infra_generique')) {
83
				$html .= sprintf($this->infraGenTpl, $this->compo_nom['epithete_infra_generique']);
96
				$html .= sprintf($this->infraGenTpl, $this->compo_nom['epithete_infra_generique']);
84
			}
97
			}
85
		}
98
		}
86
		return $html;
99
		return $html;
87
	}
100
	}
88
 
101
 
89
	private function verifierTypeInfraGen() {
102
	private function verifierTypeInfraGen() {
90
		$ok = false;
103
		$ok = false;
91
		if ($this->compo_nom['type_epithete'] != '' && $this->compo_nom['epithete_infra_generique'] != '') {
104
		if ($this->compo_nom['type_epithete'] != '' && $this->compo_nom['epithete_infra_generique'] != '') {
92
			$this->ajouterTypeEpithete($this->compo_nom['type_epithete']);
105
			$this->ajouterTypeEpithete($this->compo_nom['type_epithete']);
93
			$ok = true;
106
			$ok = true;
94
		}
107
		}
95
		return $ok;
108
		return $ok;
96
	}
109
	}
97
 
110
 
98
	private function ajouterBaliseTypeInfraGen() {
111
	private function ajouterBaliseTypeInfraGen() {
99
		$html = '';
112
		$html = '';
100
		$type = $this->compo_nom['type_epithete'];
113
		$type = $this->compo_nom['type_epithete'];
101
 
114
 
102
		if ($type == 'agg.') {
115
		if ($type == 'agg.') {
103
			// Ajout de l'infra gen avant le type s'il est égal à agg.
116
			// Ajout de l'infra gen avant le type s'il est égal à agg.
104
			$html .= ' '.$this->ajouterBaliseInfraGen().
117
			$html .= ' '.$this->ajouterBaliseInfraGen().
105
					' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
118
					' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
106
		} else {
119
		} else {
107
			$html .= ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type).
120
			$html .= ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type).
108
					' '.$this->ajouterBaliseInfraGen();
121
					' '.$this->ajouterBaliseInfraGen();
109
		}
122
		}
110
		return $html;
123
		return $html;
111
	}
124
	}
112
 
125
 
113
	private function ajouterBaliseTypeInfraSp() {
126
	private function ajouterBaliseTypeInfraSp() {
114
		$html = '';
127
		$html = '';
115
		$type = $this->compo_nom['type_epithete'];
128
		$type = $this->compo_nom['type_epithete'];
116
		$infraSp = $this->compo_nom['epithete_infra_sp'];
129
		$infraSp = $this->compo_nom['epithete_infra_sp'];
117
 
130
 
118
		if ($infraSp != '') {
131
		if ($infraSp != '') {
119
			if ($type != '') {
132
			if ($type != '') {
120
				$this->ajouterTypeEpithete($type);
133
				$this->ajouterTypeEpithete($type);
121
				$html = ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
134
				$html = ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
122
			} else {
135
			} else {
123
				$message = "Nom #%s contient un épithète infra-spécifique mais son type n'est pas renseigné.";
136
				$message = "Nom #%s contient un épithète infra-spécifique mais son type n'est pas renseigné.";
124
				$this->traiterErreur($message, array($this->num));
137
				$this->traiterErreur($message, array($this->num));
125
			}
138
			}
126
		}
139
		}
127
		return $html;
140
		return $html;
128
	}
141
	}
129
 
142
 
130
	private function ajouterCultivarGpComm() {
143
	private function ajouterCultivarGpComm() {
131
		$html = '';
144
		$html = '';
132
		if ($this->avoirInfo('cultivar_groupe')) {
145
		if ($this->avoirInfo('cultivar_groupe')) {
133
			$html .= ' '.$this->ajouterCultivarGroupe();
146
			$html .= ' '.$this->ajouterCultivarGroupe();
134
		}
147
		}
135
		if ($this->avoirInfo('nom_commercial')) {
148
		if ($this->avoirInfo('nom_commercial')) {
136
			$html .= ' <span class="commercial">'.$this->compo_nom['nom_commercial'].'</span>';
149
			$html .= ' '.sprintf($this->commTpl, $this->compo_nom['nom_commercial']);
137
		}
150
		}
138
		if ($this->avoirInfo('cultivar')) {
151
		if ($this->avoirInfo('cultivar')) {
139
			$html .= ' <span class="cultivar">\''.$this->compo_nom['cultivar'].'\'</span>';
152
			$html .= ' '.sprintf($this->cvarTpl, $this->compo_nom['cultivar']);
140
		}
153
		}
141
		return $html;
154
		return $html;
142
	}
155
	}
143
 
156
 
144
	private function avoirInfo($valeur) {
157
	private function avoirInfo($valeur) {
145
		return (isset($this->compo_nom[$valeur]) && $this->compo_nom[$valeur] != '') ? true : false;
158
		return (isset($this->compo_nom[$valeur]) && $this->compo_nom[$valeur] != '') ? true : false;
146
	}
159
	}
147
 
160
 
148
	/**
161
	/**
149
	 * Permet d'ajouter les groupes de cultivar en fonction de la présence d'un cultivar et de la présence d'un grex
162
	 * Permet d'ajouter les groupes de cultivar en fonction de la présence d'un cultivar et de la présence d'un grex
150
	 *
163
	 *
151
	 * L'ensemble des individus obtenu par une fécondation particulière s'appelle un le Grex (que pour les orchidées).
164
	 * L'ensemble des individus obtenu par une fécondation particulière s'appelle un le Grex (que pour les orchidées).
152
	 * Au sein du grex, certains individus peuvent se distinguer par des formes, des coloris ou autres qui font que
165
	 * Au sein du grex, certains individus peuvent se distinguer par des formes, des coloris ou autres qui font que
153
	 * l'obtenteur du grex va les sélectionner.
166
	 * l'obtenteur du grex va les sélectionner.
154
	 * les noms de groupes de cultivars sont suivis de l'abréviation « Gp » et placés entre parenthèses
167
	 * les noms de groupes de cultivars sont suivis de l'abréviation « Gp » et placés entre parenthèses
155
	 * les noms de grex, s'ils sont utilisés devant une épithète de cultivar, ne se mettent pas entre parenthèses
168
	 * les noms de grex, s'ils sont utilisés devant une épithète de cultivar, ne se mettent pas entre parenthèses
156
	 *	 ex : Cymbidium Alexanderi gx 'Westonbirt' (cultivar_groupe = Alexanderi gx) ;
169
	 *	 ex : Cymbidium Alexanderi gx 'Westonbirt' (cultivar_groupe = Alexanderi gx) ;
157
	 * les noms de groupe se mettent entre parenthèses s'ils sont devant une épithète de cultivar
170
	 * les noms de groupe se mettent entre parenthèses s'ils sont devant une épithète de cultivar
158
	 *	 ex : Dracaena fragrans (Deremenis Gp) 'Christianne' (cultivar_groupe = Deremenis)
171
	 *	 ex : Dracaena fragrans (Deremenis Gp) 'Christianne' (cultivar_groupe = Deremenis)
159
	 * Un grex peut contenir des groupes (rédaction d'un exemple de l'ICNCP)
172
	 * Un grex peut contenir des groupes (rédaction d'un exemple de l'ICNCP)
160
	 *	 ex : × Rhyncosophrocattleya Marie Lemon Stick grex Francis Suzuki Group
173
	 *	 ex : × Rhyncosophrocattleya Marie Lemon Stick grex Francis Suzuki Group
161
	 *	 ou : × Rhyncosophrocattleya Marie Lemon Stick gx Francis Suzuki Gp
174
	 *	 ou : × Rhyncosophrocattleya Marie Lemon Stick gx Francis Suzuki Gp
162
	 * @param unknown_type $val
175
	 * @param unknown_type $val
163
	 *
176
	 *
164
	 */
177
	 */
165
	private function ajouterCultivarGroupe() {
178
	private function ajouterCultivarGroupe() {
166
		$html = '';
179
		$html = '';
-
 
180
		// si le champ cultivar_groupe n'est pas vide
167
		if ($this->avoirInfo('cultivar_groupe')) {
181
		if ($this->avoirInfo('cultivar_groupe')) {
168
			$groupe = $this->compo_nom['cultivar_groupe'];
182
			$groupe = trim($this->compo_nom['cultivar_groupe']);
-
 
183
 
-
 
184
			// Sélection des templates
-
 
185
			$tplGx = $this->gxTpl;
-
 
186
			$tplGpGx = $this->gpGxSansCvarTpl;
-
 
187
			$tplGp = $this->gpSansCvarTpl;
169
			//si le champ cultivar_groupe n'est pas vide
188
			// s'il y a un cultivar, on ajoute des parenthèses au groupe (mais pas au grex)
170
			if ($this->avoirInfo('cultivar')) {
189
			if ($this->avoirInfo('cultivar')) {
171
				//si il y a un cultivar, on ajoute des parenthèses au group (mais pas au grex)
-
 
172
				if (strrpos($groupe, ' gx ') !== false) {
-
 
173
					//si le grex est composé de groupe
-
 
174
					$gpEtGx = explode(' gx ', $groupe);
190
				$tplGpGx = $this->gpGxAvecCvarTpl;
175
					$html = ' <span class="gp">'.
191
				$tplGp = $this->gpAvecCvarTpl;
176
								$gpEtGx[0].' '.'<abbr title="grex">gx</abbr>'.
-
 
177
								' '.
-
 
178
								'('.$gpEtGx[1].' <abbr title="groupe">Gp</abbr>)'.
-
 
179
							'</span>';
-
 
180
				} elseif (strrpos($groupe, ' gx') !== false) {
-
 
181
					//si il y a un grex et pas de groupe
-
 
182
					$gx = str_replace(' gx', '', $groupe);
-
 
183
					$html = ' <span class="gp">'.$gx.' <abbr title="grex">gx</abbr></span>';
-
 
184
				} else { //si il n'y a pas de grex mais un groupe
-
 
185
					$html = ' <span class="gp">('.$groupe.' <abbr title="groupe">Gp</abbr>)</span>';
-
 
186
				}
192
			}
-
 
193
 
187
			} else { //s'il n'y a pas de cultivar
194
			// Création du HTML du groupe de cultivar
188
				if (strrpos($groupe, ' gx ') !== false) {
195
			if (strrpos($groupe, ' gx ') !== false) {//si le grex est composé de groupe
189
					//si le grex est composé de groupe
-
 
190
					$gpEtGx = explode(' gx ', $groupe);
196
				$gpEtGx = explode(' gx ', $groupe);
191
					$html = ' <span class="gp">'.
-
 
192
								$gpEtGx[0].' <abbr title="grex">gx</abbr>'.
-
 
193
								' '.
-
 
194
								$gpEtGx[1].' <abbr title="groupe">Gp</abbr>'.
-
 
195
							'</span>';
-
 
196
				} elseif (strrpos($groupe, ' gx') !== false) {
197
				$html = sprintf($tplGpGx, $gpEtGx[0], $gpEtGx[1]);
197
					//si il y a un grex et pas de groupe
198
			} else if (preg_match('/ gx$/', $groupe)) {//s'il y a un grex et pas de groupe
198
					$gx = str_replace(' gx', '', $groupe);
199
				$gx = str_replace(' gx', '', $groupe);
199
					$html = ' <span class="gp">'.$gx.' <abbr title="grex">gx</abbr></span>';
200
				$html = sprintf($tplGx, $gx);
200
				} else { //si il n'y a pas de grex mais un groupe
201
			} else { //s'il n'y a pas de grex mais un groupe
201
					$html = ' <span class="gp">'.$groupe.' <abbr title="groupe">Gp</abbr></span>';
202
				$html = sprintf($tplGp, $groupe);
202
				}
-
 
203
			}
203
			}
204
		}
204
		}
205
		return $html;
205
		return $html;
206
	}
206
	}
207
 
207
 
208
	/**
208
	/**
209
	 *
209
	 *
210
	 * Permet de repérer s'il s'agit d'un hybride (infra-sp, genre, sp) ou d'une chimère.
210
	 * Permet de repérer s'il s'agit d'un hybride (infra-sp, genre, sp) ou d'une chimère.
211
	 * @param unknown_type $val
211
	 * @param unknown_type $val
212
	 * @param unknown_type $type
212
	 * @param unknown_type $type
213
	 */
213
	 */
214
	private function verifierHybridite($epithete, $type) {
214
	private function verifierHybridite($epithete, $type) {
215
		$html = '';
215
		$html = '';
216
		if ($epithete != '') {
216
		if ($epithete != '') {
217
			if (substr($epithete, 0, 2) == 'x ') {
217
			if (substr($epithete, 0, 2) == 'x ') {
218
				$html = ' <span class="hyb">x <span class="'.$type.'">'.str_replace('x ', '', $epithete).'</span></span>';
218
				$hybride = str_replace('x ', '', $epithete);
-
 
219
				$html = ' '.sprintf($this->hybrideTpl, $type, $hybride);
219
			} elseif (substr($epithete, 0, 2) == '+ ') {
220
			} elseif (substr($epithete, 0, 2) == '+ ') {
220
				$html = ' <span class="chimere">+ <span class="'.$type.'">'.str_replace('+ ', '', $epithete).'</span></span>';
221
				$hybride = str_replace('+ ', '', $epithete);
221
			} else if (substr_count($epithete, ' x ') > 1) {
222
				$html = ' '.sprintf($this->chimereTpl, $type, $hybride);
222
				// Cas d'une formule d'hybridité comprenant des parents hybrides
223
			} else if (substr_count($epithete, ' x ') > 1) {// Cas d'une formule d'hybridité comprenant des parents hybrides
223
				$html = ' '.$this->insererBaliseFormuleHyb($epithete);
224
				$html = ' '.$this->insererBaliseFormuleHyb($epithete);
224
			} elseif (substr_count($epithete, ' x ') == 1) {
225
			} elseif (substr_count($epithete, ' x ') == 1) {// Cas d'une formule d'hybridité simple
225
				// Cas d'une formule d'hybridité simple
-
 
226
				$html = ' '.$this->ajouterFomuleHybridite($epithete, $type);
226
				$html = ' '.$this->ajouterFomuleHybridite($epithete, $type);
227
			} else {
227
			} else {// Autre cas...
228
				$html = ' <span class="'.$type.'">'.$epithete.'</span>';
228
				$html = ' '.sprintf($this->hybriditeTpl, $type, $epithete);
229
			}
229
			}
230
		}
230
		}
231
		return $html;
231
		return $html;
232
	}
232
	}
233
 
233
 
234
	private function ajouterFomuleHybridite($formule, $type) {
234
	private function ajouterFomuleHybridite($formule, $type) {
235
		$tab_x = explode(' x ', $formule);
235
		$tab_x = explode(' x ', $formule);
236
		$formule_hyb = array();
236
		$formule_hyb = array();
237
		switch ($type) {
237
		switch ($type) {
238
			case 'gen' 		:
238
			case 'gen' 		:
239
				foreach ($tab_x as $hyb) {
239
				foreach ($tab_x as $hyb) {
240
					$formule_hyb[] = sprintf($this->genTpl, $hyb);
240
					$formule_hyb[] = sprintf($this->genTpl, $hyb);
241
				}
241
				}
242
				break;
242
				break;
243
			case 'sp'		:
243
			case 'sp'		:
244
				foreach ($tab_x as $hyb) {
244
				foreach ($tab_x as $hyb) {
245
					if (substr_count($hyb, ' ') >= 1) {
245
					if (substr_count($hyb, ' ') >= 1) {
246
						list($gen, $sp) = explode(' ', $hyb);
246
						list($gen, $sp) = explode(' ', $hyb);
247
						$formule_hyb[] = sprintf($this->spFHTpl, $gen, $sp);
247
						$formule_hyb[] = sprintf($this->spFHTpl, $gen, $sp);
248
					} else if (preg_match('/^[A-Z]/', $hyb)) {
248
					} else if (preg_match('/^[A-Z]/', $hyb)) {
249
						$gen = $hyb;
249
						$gen = $hyb;
250
						$formule_hyb[] = sprintf($this->genTpl, $gen);
250
						$formule_hyb[] = sprintf($this->genTpl, $gen);
251
					}
251
					}
252
				}
252
				}
253
				break;
253
				break;
254
			case 'infra-sp' :
254
			case 'infra-sp' :
255
				foreach ($tab_x as $hyb) {
255
				foreach ($tab_x as $hyb) {
256
					list($gen, $sp, $typeEpithete, $infraSp) = explode (' ', $hyb);
256
					list($gen, $sp, $typeEpithete, $infraSp) = explode (' ', $hyb);
257
					$formule_hyb[] = sprintf($this->infraSpFHTpl, $gen, $sp, $this->abbr[$typeEpithete], $typeEpithete, $infraSp);
257
					$formule_hyb[] = sprintf($this->infraSpFHTpl, $gen, $sp, $this->abbr[$typeEpithete], $typeEpithete, $infraSp);
258
				}
258
				}
259
				break;
259
				break;
260
			default : break;
260
			default : break;
261
		}
261
		}
262
		return $this->insererBaliseFormuleHyb(implode(' x ', $formule_hyb));
262
		return $this->insererBaliseFormuleHyb(implode(' x ', $formule_hyb));
263
	}
263
	}
264
 
264
 
265
	private function insererBaliseFormuleHyb($formule) {
265
	private function insererBaliseFormuleHyb($formule) {
266
		return sprintf($this->formuleHybTpl, $formule);
266
		return sprintf($this->formuleHybTpl, $formule);
267
	}
267
	}
268
}
268
}
269
?>
269
?>