changeset 10:8f1125d27079

Ajout de deux fonctions helpers qui permettent d'harmoniser le code.
author Franck Deroche <webmaster@defr.org>
date Wed, 24 Oct 2007 14:38:08 +0200
parents 3b22cee5e07b
children ff57b45eda37
files includes/class.textutils.php
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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')));
+    }
+    }
+?>