Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 504 → Rev 522

/trunk/jrest/services/Cel.php
269,10 → 269,22
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DE MÉTHODES COMMUNES ENTRE LES SERVICES
protected function getUrlImage($id, $format = 'L') {
$url_tpl = $this->config['settings']['celImgUrlTpl'];
$id = sprintf('%09s', $id).$format;
$url = sprintf($url_tpl, $id);
return $url;
}
protected function encoderMotCle($mot_cle) {
return md5(mb_strtolower($mot_cle));
}
protected function creerAuteur($courriel, $pourAdmin = false) {
$auteur = ($pourAdmin) ? $courriel : $this->tronquerCourriel($courriel);
return $auteur;
}
protected function tronquerCourriel($courriel) {
$courriel = preg_replace('/[^@]+$/i', '...', $courriel);
return $courriel;
292,10 → 304,18
protected function nettoyerTexte($txt) {
$txt = preg_replace('/&(?!([a-z]+|#[0-9]+|#x[0-9][a-f]+);)/i', '&', $txt);
$txt = preg_replace('/^(?:000null|null)$/i', '', $txt);
$txt = preg_replace('/(?:000null|null)/i', '', $txt);
return $txt;
}
protected function etreNull($valeur) {
$etre_null = false;
if ($valeur == '' || $valeur == null || $valeur == '000null' || $valeur == 'null') {
$etre_null = true;
}
return $etre_null;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES SQUELETTES PHP