]> git.mxchange.org Git - friendica.git/blobdiff - library/Smarty/libs/plugins/modifiercompiler.lower.php
add smarty engine, remove some obsolete zot1 stuff
[friendica.git] / library / Smarty / libs / plugins / modifiercompiler.lower.php
diff --git a/library/Smarty/libs/plugins/modifiercompiler.lower.php b/library/Smarty/libs/plugins/modifiercompiler.lower.php
new file mode 100644 (file)
index 0000000..1845cc1
--- /dev/null
@@ -0,0 +1,31 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty lower modifier plugin\r
+ *\r
+ * Type:     modifier<br>\r
+ * Name:     lower<br>\r
+ * Purpose:  convert string to lowercase\r
+ *\r
+ * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)\r
+ * @author Monte Ohrt <monte at ohrt dot com>\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_lower($params, $compiler)\r
+{\r
+    if (Smarty::$_MBSTRING) {\r
+        return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ;\r
+    }\r
+    // no MBString fallback\r
+    return 'strtolower(' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file