From 7085a0c2f7104a56a7e946c43ba0b5736be5f4e7 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 27 Dec 2016 14:47:01 +0100 Subject: * smarty bundled --- ...y_internal_compile_private_registered_block.php | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 lib/smarty3/sysplugins/smarty_internal_compile_private_registered_block.php (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_private_registered_block.php') diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_private_registered_block.php b/lib/smarty3/sysplugins/smarty_internal_compile_private_registered_block.php new file mode 100644 index 0000000..987bc96 --- /dev/null +++ b/lib/smarty3/sysplugins/smarty_internal_compile_private_registered_block.php @@ -0,0 +1,72 @@ +smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ])) { + $tag_info = $compiler->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ]; + $callback = $tag_info[ 0 ]; + if (is_array($callback)) { + if (is_object($callback[ 0 ])) { + $callable = "array(\$_block_plugin{$this->nesting}, '{$callback[1]}')"; + $callback = + array("\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]", "->{$callback[1]}"); + } else { + $callable = "array(\$_block_plugin{$this->nesting}, '{$callback[1]}')"; + $callback = + array("\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]", "::{$callback[1]}"); + } + } else { + $callable = "\$_block_plugin{$this->nesting}"; + $callback = array("\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0]", ''); + } + } else { + $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ]; + $callback = $tag_info[ 0 ]; + if (is_array($callback)) { + $callable = "array('{$callback[0]}', '{$callback[1]}')"; + $callback = "{$callback[1]}::{$callback[1]}"; + } else { + $callable = null; + } + } + $compiler->tag_nocache = !$tag_info[ 1 ] | $compiler->tag_nocache; + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) { + $_value = str_replace("'", "^#^", $_value); + $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } + } + return array($callback, $_paramsArray, $callable); + } +} -- cgit v1.2.3