diff options
Diffstat (limited to 'libs/sysplugins/smarty_internal_template.php')
| -rw-r--r-- | libs/sysplugins/smarty_internal_template.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 01eedb8a..bb747a82 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -151,7 +151,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase */ public function render($no_output_filter = true, $display = null) { - $parentIsTpl = isset($this->parent) && $this->parent->_objType == 2; if ($this->smarty->debugging) { if (!isset($this->smarty->_debug)) { $this->smarty->_debug = new Smarty_Internal_Debug(); @@ -161,7 +160,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase // checks if template exists if (!$this->source->exists) { throw new SmartyException("Unable to load template '{$this->source->type}:{$this->source->name}'" . - ($parentIsTpl ? " in '{$this->parent->template_resource}'" : '')); + ($this->_isSubTpl() ? " in '{$this->parent->template_resource}'" : '')); } // disable caching for evaluated code if ($this->source->handler->recompiled) { @@ -212,7 +211,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase $this->smarty->_debug->display_debug($this, true); } } - if ($parentIsTpl) { + if ($this->_isSubTpl()) { foreach ($this->compiled->required_plugins as $code => $tmp1) { foreach ($tmp1 as $name => $tmp) { foreach ($tmp as $type => $data) { @@ -309,7 +308,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase // check if template object should be cached if ($forceTplCache || (isset($smarty->_cache[ 'subTplInfo' ][ $tpl->template_resource ]) && $smarty->_cache[ 'subTplInfo' ][ $tpl->template_resource ] > 1) || - ($tpl->_isParentTemplate() && isset($smarty->_cache[ 'tplObjects' ][ $tpl->parent->templateId ])) + ($tpl->_isSubTpl() && isset($smarty->_cache[ 'tplObjects' ][ $tpl->parent->templateId ])) ) { $smarty->_cache[ 'tplObjects' ][ $tpl->templateId ] = $tpl; } @@ -368,13 +367,13 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } /** - * Check if parent is template object + * Check if this is a sub template * - * @return bool true if parent is template + * @return bool true is sub template */ - public function _isParentTemplate() + public function _isSubTpl() { - return isset($this->parent) && $this->parent->_objType == 2; + return isset($this->parent) && $this->parent->_isTplObj(); } /** |
