Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 469 → Rev 470

/trunk/widget/bibliotheque/WidgetCommun.php
18,6 → 18,46
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DU DAO
protected function getDao() {
if (! isset($this->dao)) {
$this->dao = new Dao();
}
return $this->dao;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DE MÉTHODES COMMUNES ENTRE LES SERVICES
protected function encoderMotCle($mot_cle) {
return md5(mb_strtolower($mot_cle));
}
protected function tronquerCourriel($courriel) {
$courriel = preg_replace('/[^@]+$/i', '...', $courriel);
return $courriel;
}
protected function nettoyerTableau($tableau) {
foreach ($tableau as $cle => $valeur) {
if (is_array($valeur)) {
$valeur = $this->nettoyerTableau($valeur);
} else {
$valeur = $this->nettoyerTexte($valeur);
}
$tableau[$cle] = $valeur;
}
return $tableau;
}
protected function nettoyerTexte($txt) {
$txt = preg_replace('/&(?!(a-z+|#0-9+|#x0-9a-f+);)/i', '&', $txt);
$txt = preg_replace('/000null/i', '', $txt);
return $txt;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de l'ENVOIE au NAVIGATEUR
 
protected function envoyer($donnees = null, $mime = 'text/html', $encodage = 'utf-8') {