From 90e471646d5e4bc2aa3c3afb6ca3da1f7bcc2f9a Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 15 Nov 2010 17:31:47 +0100 Subject: [PATCH] LSsession / Smarty : Added getFData() smarty function --- public_html/includes/class/class.LSsession.php | 2 ++ public_html/includes/functions.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/public_html/includes/class/class.LSsession.php b/public_html/includes/class/class.LSsession.php index 27902a51..1520ebf7 100644 --- a/public_html/includes/class/class.LSsession.php +++ b/public_html/includes/class/class.LSsession.php @@ -148,6 +148,8 @@ class LSsession { $GLOBALS['Smarty'] -> debugging = true; } } + + $GLOBALS['Smarty'] -> register_function('getFData','smarty_getFData'); $GLOBALS['Smarty'] -> assign('LS_CSS_DIR',LS_CSS_DIR); $GLOBALS['Smarty'] -> assign('LS_IMAGES_DIR',LS_IMAGES_DIR); diff --git a/public_html/includes/functions.php b/public_html/includes/functions.php index a65a0a6f..552fce44 100644 --- a/public_html/includes/functions.php +++ b/public_html/includes/functions.php @@ -164,6 +164,11 @@ function _getFData_extractAndModify($data,$ch) { return $val; } +function smarty_getFData($params) { + extract($params); + echo getFData($format,$data,$meth=NULL); +} + function getFieldInFormat($format) { $fields=array(); $expr="%{([A-Za-z0-9]+)(\:(-?[0-9])+)?(\:(-?[0-9]+))?(-)?(\!|\_)?(~)?}";