diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 0d478512..abd6ea0a 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -196,8 +196,6 @@ class Smarty extends Smarty_Internal_Data { public $caching_type = 'file'; // internal cache resource types public $cache_resource_types = array('file'); - // internal cache resource objects - public $cache_resource_objects = array(); // internal config properties public $properties = array(); // config type @@ -387,12 +385,16 @@ class Smarty extends Smarty_Internal_Data { * @param string $ |object $template the resource handle of the template file or template object * @param mixed $cache_id cache id to be used with this template * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables * @return boolean cache status */ - public function isCached($template, $cache_id = null, $compile_id = null) + public function isCached($template, $cache_id = null, $compile_id = null, $parent = null) { + if ($parent === null) { + $parent = $this; + } if (!($template instanceof $this->template_class)) { - $template = $this->createTemplate ($template, $cache_id, $compile_id, $this); + $template = $this->createTemplate ($template, $cache_id, $compile_id, $parent); } // return cache status of template return $template->isCached(); diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index be20df41..6b81ed0c 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -335,8 +335,18 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { * * @return boolean true if cache is valid */ - public function isCached ($no_render = true) + public function isCached ($template = null, $cache_id = null, $compile_id = null, $parent = null) { + if ($template === null) { + $no_render = true; + } elseif ($template === false) { + $no_render = false; + } else { + if ($parent === null) { + $parent = $this; + } + $this->smarty->isCached ($template, $cache_id, $compile_id, $parent); + } if ($this->isCached === null) { $this->isCached = false; if (($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED) && !$this->resource_object->isEvaluated) {