LSsession / Smarty : Added getFData() smarty function
authorBenjamin Renard <brenard@easter-eggs.com>
Mon, 15 Nov 2010 16:31:47 +0000 (17:31 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Mon, 15 Nov 2010 16:31:47 +0000 (17:31 +0100)
public_html/includes/class/class.LSsession.php
public_html/includes/functions.php

index 27902a5..1520ebf 100644 (file)
@@ -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);
index a65a0a6..552fce4 100644 (file)
@@ -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]+))?(-)?(\!|\_)?(~)?}";