# HG changeset patch # User Franck Deroche # Date 1193229488 -7200 # Node ID 8f1125d270799f37a79796f37fdf821296fc58f7 # Parent 3b22cee5e07b8a2884c0e84bb9a84ee17d860110 Ajout de deux fonctions helpers qui permettent d'harmoniser le code. diff -r 3b22cee5e07b -r 8f1125d27079 includes/class.textutils.php --- a/includes/class.textutils.php Tue Oct 23 16:05:13 2007 +0200 +++ b/includes/class.textutils.php Wed Oct 24 14:38:08 2007 +0200 @@ -26,5 +26,19 @@ $ajout = array_diff($arNew, $arOld); $suppr = array_diff($arOld, $arNew); } + + public static function StripTitle($Titre) { + $Titre_url = str_replace(" ", "_", strip_tags($Titre)); + $Titre_url = str_replace("-", "_", $Titre_url); + $Titre_url = str_replace(array("é", "è"), "e", $Titre_url); + $Titre_url = str_replace("à", "a", $Titre_url); + $Titre_url = str_replace("ù", "u", $Titre_url); + $Titre_url = str_replace(array("î", "ï"), "i", $Titre_url); + return $Titre_url; } -?> \ No newline at end of file + + public static function getMonthName($monthNumber) { + return ucfirst(strftime('%B', strtotime('2007-' . $monthNumber . '-01'))); + } + } +?>