diff options
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php index 68ab644fc..78d95f720 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -27,14 +27,14 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C /** * Compiles code for the execution of a block function * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of block function + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of block function * * @return string compiled code */ - public function compile($args, $compiler, $parameter, $tag) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag) { if (!isset($tag[5]) || substr($tag, - 5) != 'close') { // opening tag of block plugin @@ -69,11 +69,11 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C $function = $tag_info[0]; // compile code if (!is_array($function)) { - $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + $output = "<?php \$_smarty_tpl->smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; } elseif (is_object($function[0])) { - $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + $output = "<?php \$_smarty_tpl->smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; } else { - $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; + $output = "<?php \$_smarty_tpl->smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; } } else { // must endblock be nocache? @@ -95,14 +95,22 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C $mod_pre = $mod_post = ''; } else { $mod_pre = ' ob_start(); '; - $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], 'value' => 'ob_get_clean()')) . ';'; + $mod_post = 'echo ' . + $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], + 'value' => 'ob_get_clean()')) . ';'; } if (!is_array($function)) { - $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . " echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat);" . $mod_post . " } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . + " echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat);" . $mod_post . + " } array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; } elseif (is_object($function[0])) { - $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . " echo \$_smarty_tpl->smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . "} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . + " echo \$_smarty_tpl->smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . + $mod_post . "} array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; } else { - $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . " echo {$function[0]}::{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . "} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . + " echo {$function[0]}::{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . + $mod_post . "} array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; } } |