From 7085a0c2f7104a56a7e946c43ba0b5736be5f4e7 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 27 Dec 2016 14:47:01 +0100 Subject: * smarty bundled --- .../sysplugins/smarty_internal_compile_call.php | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 lib/smarty3/sysplugins/smarty_internal_compile_call.php (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_call.php') diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_call.php b/lib/smarty3/sysplugins/smarty_internal_compile_call.php new file mode 100644 index 0000000..33480de --- /dev/null +++ b/lib/smarty3/sysplugins/smarty_internal_compile_call.php @@ -0,0 +1,89 @@ +getAttributes($compiler, $args); + // save possible attributes + if (isset($_attr[ 'assign' ])) { + // output will be stored in a smarty variable instead of being displayed + $_assign = $_attr[ 'assign' ]; + } + //$_name = trim($_attr['name'], "'\""); + $_name = $_attr[ 'name' ]; + unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'nocache' ]); + // set flag (compiled code of {function} must be included in cache file + if (!$compiler->template->caching || $compiler->nocache || $compiler->tag_nocache) { + $_nocache = 'true'; + } else { + $_nocache = 'false'; + } + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + //$compiler->suppressNocacheProcessing = true; + // was there an assign attribute + if (isset($_assign)) { + $_output = + "ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\n\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n"; + } else { + $_output = + "ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\n"; + } + return $_output; + } +} -- cgit v1.2.3