Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 15 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 16
Line 7... Line 7...
7
 * @package		Collection
7
 * @package		Collection
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: ColControleur.php 15 2010-03-19 17:55:16Z jpm $
12
 * @version		SVN: $Id: ColControleur.php 16 2010-03-22 11:25:21Z jpm $
13
 */
13
 */
14
abstract class ColControleur extends Controleur {
14
abstract class ColControleur extends Controleur {
Line 15... Line 15...
15
 
15
 
16
	const RENDU_TETE = 'tete';
16
	const RENDU_TETE = 'tete';
Line 87... Line 87...
87
	 */
87
	 */
88
	private function fusionnerSortie($sortie) {
88
	private function fusionnerSortie($sortie) {
89
		$this->sortie = array_merge($this->sortie, $sortie);
89
		$this->sortie = array_merge($this->sortie, $sortie);
90
	}
90
	}
Line -... Line 91...
-
 
91
	
-
 
92
	protected function construireTxtTruckSimple($chaine_a_analyser) {
-
 
93
		return $this->construireTxtTruck($chaine_a_analyser, false, false);
-
 
94
	}
91
	
95
	
92
	protected function construireTxtTruckSansMajuscule($chaine_a_analyser) {
96
	protected function construireTxtTruckSansMajuscule($chaine_a_analyser) {
93
		return $this->construireTxtTruck($chaine_a_analyser, false);
97
		return $this->construireTxtTruck($chaine_a_analyser, false);
Line -... Line 98...
-
 
98
	}
-
 
99
	
-
 
100
	protected function construireTxtTruckSansPointFinal($chaine_a_analyser) {
-
 
101
		return $this->construireTxtTruck($chaine_a_analyser, true, false);
94
	}
102
	}
95
	
103
	
96
	protected function construireTxtTruck($chaine_a_analyser, $majuscule = true) {
104
	protected function construireTxtTruck($chaine_a_analyser, $majuscule = true, $point_final = true) {
97
		$termes = array();
105
		$termes = array();
98
		if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != ''))	{
106
		if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != ''))	{
99
			$valeurs = explode(self::SEPARATEUR_VALEURS, $chaine_a_analyser);
107
			$valeurs = explode(self::SEPARATEUR_VALEURS, $chaine_a_analyser);
Line 107... Line 115...
107
					}
115
					}
108
				}
116
				}
109
			}
117
			}
110
		}
118
		}
Line 111... Line 119...
111
		
119
		
112
		$chaine_a_retourner = $this->formaterTableauDeTxt($termes, $majuscule);
120
		$chaine_a_retourner = $this->formaterTableauDeTxt($termes, $majuscule, $point_final);
113
		return $chaine_a_retourner;
121
		return $chaine_a_retourner;
Line 114... Line 122...
114
	}
122
	}
115
	
123
	
Line 139... Line 147...
139
	protected function formaterSautDeLigne($chaine_a_formater) {
147
	protected function formaterSautDeLigne($chaine_a_formater) {
140
		$txt_a_retourner = preg_replace('/\n/', '<br />', $chaine_a_formater);
148
		$txt_a_retourner = preg_replace('/\n/', '<br />', $chaine_a_formater);
141
		return $txt_a_retourner;
149
		return $txt_a_retourner;
142
	}
150
	}
Line 143... Line 151...
143
	
151
	
144
	protected function formaterTableauDeTxt($tableau_de_txt, $majuscule = true) {
152
	protected function formaterTableauDeTxt($tableau_de_txt, $majuscule = true, $point_final = true) {
145
		$chaine_a_afficher = '';
153
		$chaine_a_afficher = '';
146
		$taille_du_tableau = count($tableau_de_txt);
154
		$taille_du_tableau = count($tableau_de_txt);
147
		if ($taille_du_tableau > 0) {
155
		if ($taille_du_tableau > 0) {
148
			$index_avt_dernier = $taille_du_tableau - 1;
156
			$index_avt_dernier = $taille_du_tableau - 1;
149
			for ($i = 0; $i < $taille_du_tableau; $i++)	{
157
			for ($i = 0; $i < $taille_du_tableau; $i++)	{
150
				$mot = $tableau_de_txt[$i];
158
				$mot = $tableau_de_txt[$i];
151
				if ($i != $index_avt_dernier) {
159
				if ($i != $index_avt_dernier) {
152
					$chaine_a_afficher .= $mot.', ';
160
					$chaine_a_afficher .= $mot.', ';
153
				} else {
161
				} else {
-
 
162
					$chaine_a_afficher .= $this->nettoyerPointFinal($mot);
-
 
163
					if ($point_final) {
-
 
164
						$chaine_a_afficher .= '.';
154
					$chaine_a_afficher .= $this->nettoyerPointFinal($mot).'.';
165
					}
155
				}
166
				}
156
			}
167
			}
157
		}
168
		}
158
		if ($majuscule) {
169
		if ($majuscule) {