From 2e8b7c864d3c9766ea09b5a87a5e3a701e1edfe8 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Thu, 6 May 2010 00:11:30 +0000 Subject: [PATCH] - implementation of $smarty->default_modifiers as in Smarty2 --- change_log.txt | 1 + ...ernal_compile_private_print_expression.php | 45 +++++++++++-------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/change_log.txt b/change_log.txt index 338889a5..39d7583e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ 05/05/2010 - bugfix on {insert} to cache parameter +- implementation of $smarty->default_modifiers as in Smarty2 01/05/2010 - bugfix on handling of variable method names at object chaning diff --git a/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/libs/sysplugins/smarty_internal_compile_private_print_expression.php index 7f72a76d..e72ca46c 100644 --- a/libs/sysplugins/smarty_internal_compile_private_print_expression.php +++ b/libs/sysplugins/smarty_internal_compile_private_print_expression.php @@ -1,24 +1,24 @@ compiler = $compiler; @@ -49,10 +49,19 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C // display value $this->compiler->has_output = true; if (isset($this->compiler->smarty->registered_filters['variable'])) { - $output = 'smarty, $_smarty_tpl, ' . $_attr['filter'] . ');?>'; + $output = 'Smarty_Internal_Filter_Handler::runFilter(\'variable\', ' . $_attr['value'] . ',$_smarty_tpl->smarty, $_smarty_tpl, ' . $_attr['filter'] . ')'; } else { - $output = ''; + $output = $_attr['value']; } + if (!isset($_attr['nofilter']) && isset($this->compiler->smarty->default_modifiers)) { + foreach ($this->compiler->smarty->default_modifiers as $default_modifier) { + $mod_array = explode (':', $default_modifier); + $modifier = $mod_array[0]; + $mod_array[0] = $output; + $output = $this->compiler->compileTag('private_modifier', array('modifier' => $modifier, 'params' => implode(", ", $mod_array))); + } + } + $output = ''; } return $output; }