diff --git a/public_html/includes/class/class.LStemplate.php b/public_html/includes/class/class.LStemplate.php
index 2bedd3c4..9f816f38 100644
--- a/public_html/includes/class/class.LStemplate.php
+++ b/public_html/includes/class/class.LStemplate.php
@@ -118,6 +118,11 @@ class LStemplate {
die(_("LStemplate : Smarty version not recognized."));
}
+ self :: registerFunction("getFData", "LStemplate_smarty_getFData");
+ self :: registerFunction("tr", "LStemplate_smarty_tr");
+ self :: registerFunction("img", "LStemplate_smarty_img");
+ self :: registerFunction("css", "LStemplate_smarty_css");
+
return True;
}
else {
@@ -258,6 +263,18 @@ class LStemplate {
return self :: $_smarty -> fetch("ls:$template");
}
+ /**
+ * Register a template function
+ *
+ * @param[in] string $name The function name in template
+ * @param[in] string $function_name The function name in PHP
+ *
+ * @retval void
+ */
+ public static function registerFunction($name,$function_name) {
+ LStemplate_register_function($name,$function_name);
+ }
+
}
function LStemplate_smarty_getFData($params) {
diff --git a/public_html/includes/class/class.LStemplate_smarty2_support.php b/public_html/includes/class/class.LStemplate_smarty2_support.php
index 57d598d9..5c3b12da 100644
--- a/public_html/includes/class/class.LStemplate_smarty2_support.php
+++ b/public_html/includes/class/class.LStemplate_smarty2_support.php
@@ -101,10 +101,14 @@ LStemplate :: $_smarty -> register_resource('ls', array(
'LStemplate_smarty_get_trusted'
)
);
-
-// Register special template functions
-LStemplate :: $_smarty -> register_function('getFData','LStemplate_smarty_getFData');
-LStemplate :: $_smarty -> register_function('tr','LStemplate_smarty_tr');
-LStemplate :: $_smarty -> register_function('img','LStemplate_smarty_img');
-LStemplate :: $_smarty -> register_function('css','LStemplate_smarty_css');
-
+/**
+ * Register a template function
+ *
+ * @param[in] string $name The function name in template
+ * @param[in] string $function_name The function name in PHP
+ *
+ * @retval void
+ */
+function LStemplate_register_function($name,$function_name) {
+ LStemplate :: $_smarty -> register_function($name,$function_name);
+}
diff --git a/public_html/includes/class/class.LStemplate_smarty3_support.php b/public_html/includes/class/class.LStemplate_smarty3_support.php
index 36d43a36..4c781142 100644
--- a/public_html/includes/class/class.LStemplate_smarty3_support.php
+++ b/public_html/includes/class/class.LStemplate_smarty3_support.php
@@ -60,9 +60,14 @@ class Smarty_Resource_LdapSaisie extends Smarty_Resource_Custom {
// Register 'ls' template ressource
LStemplate :: $_smarty -> registerResource('ls', new Smarty_Resource_LdapSaisie());
-// Register special template functions
-LStemplate :: $_smarty -> registerPlugin("function","getFData", "LStemplate_smarty_getFData");
-LStemplate :: $_smarty -> registerPlugin("function","tr", "LStemplate_smarty_tr");
-LStemplate :: $_smarty -> registerPlugin("function","img", "LStemplate_smarty_img");
-LStemplate :: $_smarty -> registerPlugin("function","css", "LStemplate_smarty_css");
-
+/**
+ * Register a template function
+ *
+ * @param[in] string $name The function name in template
+ * @param[in] string $function_name The function name in PHP
+ *
+ * @retval void
+ */
+function LStemplate_register_function($name,$function_name) {
+ LStemplate :: $_smarty -> registerPlugin("function",$name,$function_name);
+}