Subversion Repositories eFlore/Applications.cel

Rev

Rev 1382 | Rev 2646 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1382 Rev 2406
Line 52... Line 52...
52
	}
52
	}
Line 53... Line 53...
53
	
53
 
54
	//+----------------------------------------------------------------------------------------------------------------+
54
	//+----------------------------------------------------------------------------------------------------------------+
Line -... Line 55...
-
 
55
	// GESTION DE MÉTHODES COMMUNES ENTRE LES SERVICES
-
 
56
 
-
 
57
	/**
-
 
58
	 * Transformer une chaine en tableau si elle est de la forme :
-
 
59
	 *  - "cle=valeur,cle=valeur,..." : tableau associatif
-
 
60
	 *  - "valeur, valeur,..." : tableau
-
 
61
	 *
-
 
62
	 * @param String $chaine la chaine à transformer
-
 
63
	 * @return le tableau issu de la chaine.
-
 
64
	 */
-
 
65
	public function transformerEnTableau($chaine) {
-
 
66
		$tableau = array();
-
 
67
		if (empty($chaine) === false) {
-
 
68
			$tableauPartiel = explode(',', $chaine);
-
 
69
			foreach ($tableauPartiel as $champ) {
-
 
70
				if (strpos($champ, '=') === false) {
-
 
71
					$tableau[] = trim($champ);
-
 
72
				} else {
-
 
73
					list($cle, $val) = explode('=', $champ);
-
 
74
					$tableau[trim($cle)] = trim($val);
-
 
75
				}
-
 
76
			}
-
 
77
		}
-
 
78
		return $tableau;
55
	// GESTION DE MÉTHODES COMMUNES ENTRE LES SERVICES
79
	}
56
	
80
 
57
	protected function getUrlImage($id, $format = 'L') {
81
	protected function getUrlImage($id, $format = 'L') {
58
		$url_tpl = $this->config['chemins']['celImgUrlTpl'];
82
		$url_tpl = $this->config['chemins']['celImgUrlTpl'];
59
		$id = sprintf('%09s', $id).$format;
83
		$id = sprintf('%09s', $id).$format;
Line 426... Line 450...
426
	    $str = preg_replace('#&[^;]+;#', '', $str); // supprime les autres caractères
450
	    $str = preg_replace('#&[^;]+;#', '', $str); // supprime les autres caractères
Line 427... Line 451...
427
	    
451
 
428
	    return $str;
452
	    return $str;
429
	}
453
	}
430
}
-
 
431
?>
454
}