| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |  * Smarty Internal Plugin Template | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |  * This file contains the Smarty template engine | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |  * @package Smarty | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |  * @subpackage Template | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |  * @author Uwe Tews | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |  * Main class with template data structures and methods | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage Template | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @property Smarty_Template_Source   $source | 
					
						
							|  |  |  |  * @property Smarty_Template_Compiled $compiled | 
					
						
							|  |  |  |  * @property Smarty_Template_Cached   $cached | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | class Smarty_Internal_Template extends Smarty_Internal_TemplateBase | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * cache_id | 
					
						
							|  |  |  |      * @var string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     public $cache_id = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * $compile_id | 
					
						
							|  |  |  |      * @var string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     public $compile_id = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * caching enabled | 
					
						
							|  |  |  |      * @var boolean | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     public $caching = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * cache lifetime in seconds | 
					
						
							|  |  |  |      * @var integer | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-09-01 21:11:42 +00:00
										 |  |  |     public $cache_lifetime = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Template resource | 
					
						
							|  |  |  |      * @var string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     public $template_resource = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * flag if compiled template is invalid and must be (re)compiled | 
					
						
							|  |  |  |      * @var bool | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     public $mustCompile = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * flag if template does contain nocache code sections | 
					
						
							|  |  |  |      * @var bool | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     public $has_nocache_code = false; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * special compiled and cached template properties | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public $properties = array('file_dependency' => array(), | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |         'nocache_hash' => '', | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         'function' => array()); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * required plugins | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2010-02-05 17:03:22 +00:00
										 |  |  |     public $required_plugins = array('compiled' => array(), 'nocache' => array()); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Global smarty instance | 
					
						
							|  |  |  |      * @var Smarty | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2010-03-09 15:14:11 +00:00
										 |  |  |     public $smarty = null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * blocks for template inheritance | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2010-09-08 17:40:00 +00:00
										 |  |  |     public $block_data = array(); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * variable filters | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public $variable_filters = array(); | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * optional log of tag/attributes | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     public $used_tags = array(); | 
					
						
							| 
									
										
										
										
											2011-09-23 20:21:16 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * internal flag to allow relative path in child template blocks | 
					
						
							|  |  |  |      * @var bool | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public $allow_relative_path = false; | 
					
						
							| 
									
										
										
										
											2011-10-11 15:49:19 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * internal capture runtime stack | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-12-09 22:05:16 +00:00
										 |  |  |     public $_capture_stack = array(0 => array()); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * Create template data object | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * Some of the global Smarty settings copied to template scope | 
					
						
							|  |  |  |      * It load the required template resources and cacher plugins | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param string                   $template_resource template resource string | 
					
						
							|  |  |  |      * @param Smarty                   $smarty            Smarty instance | 
					
						
							|  |  |  |      * @param Smarty_Internal_Template $_parent           back pointer to parent object with variables or null | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param mixed                    $_cache_id         cache   id or null | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param mixed                    $_compile_id       compile id or null | 
					
						
							|  |  |  |      * @param bool                     $_caching          use caching? | 
					
						
							|  |  |  |      * @param int                      $_cache_lifetime   cache life-time in seconds | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2009-11-26 22:49:56 +00:00
										 |  |  |     public function __construct($template_resource, $smarty, $_parent = null, $_cache_id = null, $_compile_id = null, $_caching = null, $_cache_lifetime = null) | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         $this->smarty = &$smarty; | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |         // Smarty parameter
 | 
					
						
							|  |  |  |         $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id; | 
					
						
							|  |  |  |         $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id; | 
					
						
							| 
									
										
										
										
											2009-11-26 22:49:56 +00:00
										 |  |  |         $this->caching = $_caching === null ? $this->smarty->caching : $_caching; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($this->caching === true) | 
					
						
							|  |  |  |             $this->caching = Smarty::CACHING_LIFETIME_CURRENT; | 
					
						
							|  |  |  |         $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         $this->parent = $_parent; | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |         // Template resource
 | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         $this->template_resource = $template_resource; | 
					
						
							| 
									
										
										
										
											2010-09-10 11:15:15 +00:00
										 |  |  |         // copy block data of template inheritance
 | 
					
						
							| 
									
										
										
										
											2010-11-13 17:48:30 +00:00
										 |  |  |         if ($this->parent instanceof Smarty_Internal_Template) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $this->block_data = $this->parent->block_data; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * Returns if the current template must be compiled by the Smarty compiler | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * It does compare the timestamps of template source and the compiled templates and checks the force compile configuration | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * @return boolean true if the template must be compiled | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function mustCompile() | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if (!$this->source->exists) { | 
					
						
							| 
									
										
										
										
											2011-09-24 18:20:13 +00:00
										 |  |  |             if ($this->parent instanceof Smarty_Internal_Template) { | 
					
						
							|  |  |  |                 $parent_resource = " in '$this->parent->template_resource}'"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $parent_resource = ''; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}"); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |         if ($this->mustCompile === null) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $this->mustCompile = (!$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || $this->compiled->timestamp === false || | 
					
						
							|  |  |  |                     ($this->smarty->compile_check && $this->compiled->timestamp < $this->source->timestamp))); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |         return $this->mustCompile; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * Compiles the template | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * If the template is not evaluated the compiled template is saved on disk | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function compileTemplateSource() | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if (!$this->source->recompiled) { | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |             $this->properties['file_dependency'] = array(); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             if ($this->source->components) { | 
					
						
							| 
									
										
										
										
											2013-08-24 18:46:31 +00:00
										 |  |  |                 // for the extends resource the compiler will fill it
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 // uses real resource for file dependency
 | 
					
						
							| 
									
										
										
										
											2013-08-24 18:46:31 +00:00
										 |  |  |                 // $source = end($this->source->components);
 | 
					
						
							|  |  |  |                 // $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $source->type);
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             } else { | 
					
						
							|  |  |  |                 $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $this->source->type); | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |         // compile locking
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($this->smarty->compile_locking && !$this->source->recompiled) { | 
					
						
							|  |  |  |             if ($saved_timestamp = $this->compiled->timestamp) { | 
					
						
							|  |  |  |                 touch($this->compiled->filepath); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |         // call compiler
 | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |         try { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $code = $this->compiler->compileTemplate($this); | 
					
						
							|  |  |  |         } catch (Exception $e) { | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |             // restore old timestamp in case of error
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             if ($this->smarty->compile_locking && !$this->source->recompiled && $saved_timestamp) { | 
					
						
							|  |  |  |                 touch($this->compiled->filepath, $saved_timestamp); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |             throw $e; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |         // compiling succeded
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if (!$this->source->recompiled && $this->compiler->write_compiled_code) { | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |             // write compiled template
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $_filepath = $this->compiled->filepath; | 
					
						
							|  |  |  |             if ($_filepath === false) | 
					
						
							|  |  |  |                 throw new SmartyException('getCompiledFilepath() did not return a destination to save the compiled template to'); | 
					
						
							|  |  |  |             Smarty_Internal_Write_File::writeFile($_filepath, $code, $this->smarty); | 
					
						
							|  |  |  |             $this->compiled->exists = true; | 
					
						
							|  |  |  |             $this->compiled->isCompiled = true; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         // release compiler object to free memory
 | 
					
						
							|  |  |  |         unset($this->compiler); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      * Writes the cached template output | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @return bool | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function writeCachedContent($content) | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($this->source->recompiled || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) { | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |             // don't write cache file
 | 
					
						
							|  |  |  |             return false; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |         $this->properties['cache_lifetime'] = $this->cache_lifetime; | 
					
						
							| 
									
										
										
										
											2014-02-17 18:21:31 +00:00
										 |  |  |         $this->properties['unifunc'] = 'content_' . str_replace(array('.',','), '_', uniqid('', true)); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $content = $this->createTemplateCodeFrame($content, true); | 
					
						
							|  |  |  |         $_smarty_tpl = $this; | 
					
						
							|  |  |  |         eval("?>" . $content); | 
					
						
							|  |  |  |         $this->cached->valid = true; | 
					
						
							|  |  |  |         $this->cached->processed = true; | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return $this->cached->write($this, $content); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * Template code runtime function to get subtemplate content | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param string  $template       the resource handle of the template file | 
					
						
							|  |  |  |      * @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 integer $caching        cache mode | 
					
						
							|  |  |  |      * @param integer $cache_lifetime life time of cache data | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param array   $vars           optional  variables to assign | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param int     $parent_scope   scope in which {include} should execute | 
					
						
							|  |  |  |      * @returns string template content | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope) | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         // already in template cache?
 | 
					
						
							| 
									
										
										
										
											2011-10-21 18:40:16 +00:00
										 |  |  |         if ($this->smarty->allow_ambiguous_resources) { | 
					
						
							| 
									
										
										
										
											2013-10-13 17:49:38 +00:00
										 |  |  |             $_templateId = Smarty_Resource::getUniqueTemplateName($this, $template) . $cache_id . $compile_id; | 
					
						
							| 
									
										
										
										
											2011-10-21 18:40:16 +00:00
										 |  |  |         } else { | 
					
						
							|  |  |  |             $_templateId = $this->smarty->joined_template_dir . '#' . $template . $cache_id . $compile_id; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-21 12:10:41 +00:00
										 |  |  |         if (isset($_templateId[150])) { | 
					
						
							|  |  |  |             $_templateId = sha1($_templateId); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if (isset($this->smarty->template_objects[$_templateId])) { | 
					
						
							|  |  |  |             // clone cached template object because of possible recursive call
 | 
					
						
							|  |  |  |             $tpl = clone $this->smarty->template_objects[$_templateId]; | 
					
						
							|  |  |  |             $tpl->parent = $this; | 
					
						
							|  |  |  |             $tpl->caching = $caching; | 
					
						
							|  |  |  |             $tpl->cache_lifetime = $cache_lifetime; | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  |         } else { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // get variables from calling scope
 | 
					
						
							|  |  |  |         if ($parent_scope == Smarty::SCOPE_LOCAL) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = $this->tpl_vars; | 
					
						
							| 
									
										
										
										
											2012-05-22 21:00:47 +00:00
										 |  |  |             $tpl->tpl_vars['smarty'] = clone $this->tpl_vars['smarty']; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } elseif ($parent_scope == Smarty::SCOPE_PARENT) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = &$this->tpl_vars; | 
					
						
							|  |  |  |         } elseif ($parent_scope == Smarty::SCOPE_GLOBAL) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = &Smarty::$global_tpl_vars; | 
					
						
							|  |  |  |         } elseif (($scope_ptr = $this->getScopePointer($parent_scope)) == null) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = &$this->tpl_vars; | 
					
						
							| 
									
										
										
										
											2009-12-28 15:27:13 +00:00
										 |  |  |         } else { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $tpl->tpl_vars = &$scope_ptr->tpl_vars; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $tpl->config_vars = $this->config_vars; | 
					
						
							|  |  |  |         if (!empty($data)) { | 
					
						
							|  |  |  |             // set up variable values
 | 
					
						
							|  |  |  |             foreach ($data as $_key => $_val) { | 
					
						
							|  |  |  |                 $tpl->tpl_vars[$_key] = new Smarty_variable($_val); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-19 21:13:44 +00:00
										 |  |  |         return $tpl->fetch(null, null, null, null, false, false, true); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-04-18 14:46:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-19 13:22:32 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * Template code runtime function to set up an inline subtemplate | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param string  $template       the resource handle of the template file | 
					
						
							|  |  |  |      * @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 integer $caching        cache mode | 
					
						
							|  |  |  |      * @param integer $cache_lifetime life time of cache data | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param array   $vars           optional  variables to assign | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param int     $parent_scope   scope in which {include} should execute | 
					
						
							|  |  |  |      * @param string  $hash           nocache hash code | 
					
						
							|  |  |  |      * @returns string template content | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function setupInlineSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope, $hash) | 
					
						
							| 
									
										
										
										
											2009-10-12 14:37:31 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime); | 
					
						
							|  |  |  |         $tpl->properties['nocache_hash']  = $hash; | 
					
						
							|  |  |  |         // get variables from calling scope
 | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |         if ($parent_scope == Smarty::SCOPE_LOCAL) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $tpl->tpl_vars = $this->tpl_vars; | 
					
						
							| 
									
										
										
										
											2012-05-22 21:00:47 +00:00
										 |  |  |             $tpl->tpl_vars['smarty'] = clone $this->tpl_vars['smarty']; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } elseif ($parent_scope == Smarty::SCOPE_PARENT) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = &$this->tpl_vars; | 
					
						
							|  |  |  |         } elseif ($parent_scope == Smarty::SCOPE_GLOBAL) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = &Smarty::$global_tpl_vars; | 
					
						
							|  |  |  |         } elseif (($scope_ptr = $this->getScopePointer($parent_scope)) == null) { | 
					
						
							|  |  |  |             $tpl->tpl_vars = &$this->tpl_vars; | 
					
						
							| 
									
										
										
										
											2009-10-12 14:37:31 +00:00
										 |  |  |         } else { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $tpl->tpl_vars = &$scope_ptr->tpl_vars; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $tpl->config_vars = $this->config_vars; | 
					
						
							|  |  |  |         if (!empty($data)) { | 
					
						
							|  |  |  |             // set up variable values
 | 
					
						
							|  |  |  |             foreach ($data as $_key => $_val) { | 
					
						
							|  |  |  |                 $tpl->tpl_vars[$_key] = new Smarty_variable($_val); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return $tpl; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-10-12 14:37:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-04 18:12:30 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * Create code frame for compiled and cached templates | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param  string $content optional template content | 
					
						
							|  |  |  |      * @param  bool   $cache   flag for cache file | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @return string | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function createTemplateCodeFrame($content = '', $cache = false) | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         $plugins_string = ''; | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |         // include code for plugins
 | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |         if (!$cache) { | 
					
						
							|  |  |  |             if (!empty($this->required_plugins['compiled'])) { | 
					
						
							|  |  |  |                 $plugins_string = '<?php '; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 foreach ($this->required_plugins['compiled'] as $tmp) { | 
					
						
							|  |  |  |                     foreach ($tmp as $data) { | 
					
						
							| 
									
										
										
										
											2011-10-21 12:08:35 +00:00
										 |  |  |                         $file = addslashes($data['file']); | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |                         if (is_Array($data['function'])) { | 
					
						
							| 
									
										
										
										
											2012-07-18 22:31:56 +00:00
										 |  |  |                             $plugins_string .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n"; | 
					
						
							|  |  |  |                         } else { | 
					
						
							|  |  |  |                             $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n"; | 
					
						
							|  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |                 $plugins_string .= '?>'; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2010-02-05 17:03:22 +00:00
										 |  |  |             if (!empty($this->required_plugins['nocache'])) { | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |                 $this->has_nocache_code = true; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 $plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php \$_smarty = \$_smarty_tpl->smarty; "; | 
					
						
							|  |  |  |                 foreach ($this->required_plugins['nocache'] as $tmp) { | 
					
						
							|  |  |  |                     foreach ($tmp as $data) { | 
					
						
							| 
									
										
										
										
											2011-10-21 12:08:35 +00:00
										 |  |  |                         $file = addslashes($data['file']); | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |                         if (is_Array($data['function'])) { | 
					
						
							| 
									
										
										
										
											2012-07-18 22:31:56 +00:00
										 |  |  |                             $plugins_string .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n"); | 
					
						
							|  |  |  |                         } else { | 
					
						
							|  |  |  |                             $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n"); | 
					
						
							|  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2009-12-28 15:27:13 +00:00
										 |  |  |                 $plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n"; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |         // build property code
 | 
					
						
							|  |  |  |         $this->properties['has_nocache_code'] = $this->has_nocache_code; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $output = ''; | 
					
						
							|  |  |  |         if (!$this->source->recompiled) { | 
					
						
							|  |  |  |             $output = "<?php /*%%SmartyHeaderCode:{$this->properties['nocache_hash']}%%*/"; | 
					
						
							|  |  |  |             if ($this->smarty->direct_access_security) { | 
					
						
							|  |  |  |                 $output .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n"; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |         if ($cache) { | 
					
						
							|  |  |  |             // remove compiled code of{function} definition
 | 
					
						
							|  |  |  |             unset($this->properties['function']); | 
					
						
							|  |  |  |             if (!empty($this->smarty->template_functions)) { | 
					
						
							|  |  |  |                 // copy code of {function} tags called in nocache mode
 | 
					
						
							|  |  |  |                 foreach ($this->smarty->template_functions as $name => $function_data) { | 
					
						
							|  |  |  |                     if (isset($function_data['called_nocache'])) { | 
					
						
							| 
									
										
										
										
											2011-09-28 15:56:01 +00:00
										 |  |  |                         foreach ($function_data['called_functions'] as $func_name) { | 
					
						
							|  |  |  |                             $this->smarty->template_functions[$func_name]['called_nocache'] = true; | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                  foreach ($this->smarty->template_functions as $name => $function_data) { | 
					
						
							|  |  |  |                     if (isset($function_data['called_nocache'])) { | 
					
						
							|  |  |  |                         unset($function_data['called_nocache'], $function_data['called_functions'], $this->smarty->template_functions[$name]['called_nocache']); | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |                         $this->properties['function'][$name] = $function_data; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $this->properties['version'] = Smarty::SMARTY_VERSION; | 
					
						
							|  |  |  |         if (!isset($this->properties['unifunc'])) { | 
					
						
							| 
									
										
										
										
											2014-02-17 18:21:31 +00:00
										 |  |  |             $this->properties['unifunc'] = 'content_' . str_replace(array('.',','), '_', uniqid('', true)); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } | 
					
						
							|  |  |  |         if (!$this->source->recompiled) { | 
					
						
							|  |  |  |             $output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . ',' . ($cache ? 'true' : 'false') . "); /*/%%SmartyHeaderCode%%*/?>\n"; | 
					
						
							|  |  |  |             $output .= '<?php if ($_valid && !is_callable(\'' . $this->properties['unifunc'] . '\')) {function ' . $this->properties['unifunc'] . '($_smarty_tpl) {?>'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $output .= $plugins_string; | 
					
						
							|  |  |  |         $output .= $content; | 
					
						
							|  |  |  |         if (!$this->source->recompiled) { | 
					
						
							| 
									
										
										
										
											2013-08-24 18:46:31 +00:00
										 |  |  |             $output .= "<?php }} ?>\n"; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return $output; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * This function is executed automatically when a compiled or cached template file is included | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * - Decode saved properties from compiled template and cache files | 
					
						
							|  |  |  |      * - Check if compiled or cache file is valid | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param  array $properties special template properties | 
					
						
							|  |  |  |      * @param  bool  $cache      flag if called from cache file | 
					
						
							|  |  |  |      * @return bool  flag if compiled or cache file is valid | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function decodeProperties($properties, $cache = false) | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |         $this->has_nocache_code = $properties['has_nocache_code']; | 
					
						
							| 
									
										
										
										
											2009-12-28 15:27:13 +00:00
										 |  |  |         $this->properties['nocache_hash'] = $properties['nocache_hash']; | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |         if (isset($properties['cache_lifetime'])) { | 
					
						
							|  |  |  |             $this->properties['cache_lifetime'] = $properties['cache_lifetime']; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |         if (isset($properties['file_dependency'])) { | 
					
						
							|  |  |  |             $this->properties['file_dependency'] = array_merge($this->properties['file_dependency'], $properties['file_dependency']); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-12-27 15:06:49 +00:00
										 |  |  |         if (!empty($properties['function'])) { | 
					
						
							| 
									
										
										
										
											2009-12-31 16:38:12 +00:00
										 |  |  |             $this->properties['function'] = array_merge($this->properties['function'], $properties['function']); | 
					
						
							| 
									
										
										
										
											2009-12-29 20:12:11 +00:00
										 |  |  |             $this->smarty->template_functions = array_merge($this->smarty->template_functions, $properties['function']); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $this->properties['version'] = (isset($properties['version'])) ? $properties['version'] : ''; | 
					
						
							|  |  |  |         $this->properties['unifunc'] = $properties['unifunc']; | 
					
						
							|  |  |  |         // check file dependencies at compiled code
 | 
					
						
							|  |  |  |         $is_valid = true; | 
					
						
							|  |  |  |         if ($this->properties['version'] != Smarty::SMARTY_VERSION) { | 
					
						
							|  |  |  |             $is_valid = false; | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |         } elseif (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties) && !$this->compiled->isCompiled) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             foreach ($this->properties['file_dependency'] as $_file_to_check) { | 
					
						
							|  |  |  |                 if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'php') { | 
					
						
							|  |  |  |                     if ($this->source->filepath == $_file_to_check[0] && isset($this->source->timestamp)) { | 
					
						
							|  |  |  |                         // do not recheck current template
 | 
					
						
							|  |  |  |                         $mtime = $this->source->timestamp; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         // file and php types can be checked without loading the respective resource handlers
 | 
					
						
							| 
									
										
										
										
											2012-03-30 14:21:16 +00:00
										 |  |  |                         $mtime = @filemtime($_file_to_check[0]); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } elseif ($_file_to_check[2] == 'string') { | 
					
						
							|  |  |  |                     continue; | 
					
						
							|  |  |  |                 } else { | 
					
						
							| 
									
										
										
										
											2011-09-27 21:48:33 +00:00
										 |  |  |                     $source = Smarty_Resource::source(null, $this->smarty, $_file_to_check[0]); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                     $mtime = $source->timestamp; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2012-03-30 14:21:16 +00:00
										 |  |  |                 if (!$mtime || $mtime > $_file_to_check[1]) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                     $is_valid = false; | 
					
						
							|  |  |  |                     break; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if ($cache) { | 
					
						
							| 
									
										
										
										
											2013-02-28 19:17:26 +00:00
										 |  |  |             // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc
 | 
					
						
							|  |  |  |             if ($this->caching === Smarty::CACHING_LIFETIME_SAVED && | 
					
						
							|  |  |  |                 $this->properties['cache_lifetime'] >= 0 && | 
					
						
							|  |  |  |                 (time() > ($this->cached->timestamp + $this->properties['cache_lifetime']))) { | 
					
						
							|  |  |  |                 $is_valid = false; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $this->cached->valid = $is_valid; | 
					
						
							|  |  |  |         } else { | 
					
						
							| 
									
										
										
										
											2013-02-28 19:17:26 +00:00
										 |  |  |             $this->mustCompile = !$is_valid;        } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         // store data in reusable Smarty_Template_Compiled
 | 
					
						
							|  |  |  |         if (!$cache) { | 
					
						
							|  |  |  |             $this->compiled->_properties = $properties; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return $is_valid; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-10-04 18:12:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-08 18:30:03 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * Template code runtime function to create a local Smarty variable for array assignments | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param string $tpl_var tempate variable name | 
					
						
							|  |  |  |      * @param bool   $nocache cache mode of variable | 
					
						
							|  |  |  |      * @param int    $scope   scope of variable | 
					
						
							| 
									
										
										
										
											2010-07-08 18:30:03 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |     public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL) | 
					
						
							| 
									
										
										
										
											2010-07-08 18:30:03 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         if (!isset($this->tpl_vars[$tpl_var])) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $this->tpl_vars[$tpl_var] = new Smarty_variable(array(), $nocache, $scope); | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $this->tpl_vars[$tpl_var] = clone $this->tpl_vars[$tpl_var]; | 
					
						
							|  |  |  |             if ($scope != Smarty::SCOPE_LOCAL) { | 
					
						
							|  |  |  |                 $this->tpl_vars[$tpl_var]->scope = $scope; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) { | 
					
						
							|  |  |  |                 settype($this->tpl_vars[$tpl_var]->value, 'array'); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Template code runtime function to get pointer to template variable array of requested scope | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param  int   $scope requested variable scope | 
					
						
							|  |  |  |      * @return array array of template variables | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      */ | 
					
						
							|  |  |  |     public function &getScope($scope) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) { | 
					
						
							|  |  |  |             return $this->parent->tpl_vars; | 
					
						
							|  |  |  |         } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) { | 
					
						
							|  |  |  |             $ptr = $this->parent; | 
					
						
							|  |  |  |             while (!empty($ptr->parent)) { | 
					
						
							|  |  |  |                 $ptr = $ptr->parent; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             return $ptr->tpl_vars; | 
					
						
							|  |  |  |         } elseif ($scope == Smarty::SCOPE_GLOBAL) { | 
					
						
							|  |  |  |             return Smarty::$global_tpl_vars; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $null = null; | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return $null; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Get parent or root of template parent chain | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param  int   $scope pqrent or root scope | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @return mixed object | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function getScopePointer($scope) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) { | 
					
						
							|  |  |  |             return $this->parent; | 
					
						
							|  |  |  |         } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) { | 
					
						
							|  |  |  |             $ptr = $this->parent; | 
					
						
							|  |  |  |             while (!empty($ptr->parent)) { | 
					
						
							|  |  |  |                 $ptr = $ptr->parent; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             return $ptr; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return null; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-09-29 21:00:00 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * [util function] counts an array, arrayaccess/traversable or PDOStatement object | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  |      * @param  mixed $value | 
					
						
							|  |  |  |      * @return int   the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |      */ | 
					
						
							|  |  |  |     public function _count($value) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         if (is_array($value) === true || $value instanceof Countable) { | 
					
						
							|  |  |  |             return count($value); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } elseif ($value instanceof IteratorAggregate) { | 
					
						
							|  |  |  |             // Note: getIterator() returns a Traversable, not an Iterator
 | 
					
						
							|  |  |  |             // thus rewind() and valid() methods may not be present
 | 
					
						
							|  |  |  |             return iterator_count($value->getIterator()); | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |         } elseif ($value instanceof Iterator) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             return iterator_count($value); | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |         } elseif ($value instanceof PDOStatement) { | 
					
						
							|  |  |  |             return $value->rowCount(); | 
					
						
							|  |  |  |         } elseif ($value instanceof Traversable) { | 
					
						
							|  |  |  |             return iterator_count($value); | 
					
						
							|  |  |  |         } elseif ($value instanceof ArrayAccess) { | 
					
						
							|  |  |  |             if ($value->offsetExists(0)) { | 
					
						
							|  |  |  |                 return 1; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         } elseif (is_object($value)) { | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |             return count($value); | 
					
						
							| 
									
										
										
										
											2010-11-13 15:26:03 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return 0; | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-11-13 15:26:03 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-10-11 15:49:19 +00:00
										 |  |  |      * runtime error not matching capture tags | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function capture_error() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\""); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-10-21 12:08:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 17:15:06 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |     * Empty cache for this template | 
					
						
							|  |  |  |     * | 
					
						
							|  |  |  |     * @param integer $exp_time      expiration time | 
					
						
							|  |  |  |     * @return integer number of cache files deleted | 
					
						
							|  |  |  |     */ | 
					
						
							|  |  |  |     public function clearCache($exp_time=null) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Smarty_CacheResource::invalidLoadedCache($this->smarty); | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 17:54:25 +00:00
										 |  |  |         return $this->cached->handler->clear($this->smarty, $this->template_name, $this->cache_id, $this->compile_id, $exp_time); | 
					
						
							| 
									
										
										
										
											2011-10-14 17:15:06 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-10-21 12:08:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-11 15:49:19 +00:00
										 |  |  |      /** | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * set Smarty property in template context | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |      * @param string $property_name property name | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param mixed  $value         value | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |      */ | 
					
						
							|  |  |  |     public function __set($property_name, $value) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         switch ($property_name) { | 
					
						
							|  |  |  |             case 'source': | 
					
						
							|  |  |  |             case 'compiled': | 
					
						
							|  |  |  |             case 'cached': | 
					
						
							|  |  |  |             case 'compiler': | 
					
						
							|  |  |  |                 $this->$property_name = $value; | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 return; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             // FIXME: routing of template -> smarty attributes
 | 
					
						
							|  |  |  |             default: | 
					
						
							|  |  |  |                 if (property_exists($this->smarty, $property_name)) { | 
					
						
							|  |  |  |                     $this->smarty->$property_name = $value; | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                     return; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         throw new SmartyException("invalid template property '$property_name'."); | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-08 16:20:19 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * get Smarty property in template context | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |      * @param string $property_name property name | 
					
						
							| 
									
										
										
										
											2010-03-08 16:20:19 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |     public function __get($property_name) | 
					
						
							| 
									
										
										
										
											2010-03-08 16:20:19 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         switch ($property_name) { | 
					
						
							|  |  |  |             case 'source': | 
					
						
							| 
									
										
										
										
											2012-01-27 19:30:53 +00:00
										 |  |  |                 if (strlen($this->template_resource) == 0) { | 
					
						
							|  |  |  |                     throw new SmartyException('Missing template name'); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |                 $this->source = Smarty_Resource::source($this); | 
					
						
							|  |  |  |                 // cache template object under a unique ID
 | 
					
						
							|  |  |  |                 // do not cache eval resources
 | 
					
						
							|  |  |  |                 if ($this->source->type != 'eval') { | 
					
						
							| 
									
										
										
										
											2011-10-21 18:40:16 +00:00
										 |  |  |                     if ($this->smarty->allow_ambiguous_resources) { | 
					
						
							|  |  |  |                         $_templateId = $this->source->unique_resource . $this->cache_id . $this->compile_id; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $_templateId = $this->smarty->joined_template_dir . '#' . $this->template_resource . $this->cache_id . $this->compile_id; | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-21 12:10:41 +00:00
										 |  |  |                     if (isset($_templateId[150])) { | 
					
						
							|  |  |  |                         $_templateId = sha1($_templateId); | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2011-10-13 13:10:06 +00:00
										 |  |  |                     $this->smarty->template_objects[$_templateId] = $this; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 return $this->source; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             case 'compiled': | 
					
						
							|  |  |  |                 $this->compiled = $this->source->getCompiled($this); | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 return $this->compiled; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             case 'cached': | 
					
						
							|  |  |  |                 if (!class_exists('Smarty_Template_Cached')) { | 
					
						
							|  |  |  |                     include SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 $this->cached = new Smarty_Template_Cached($this); | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 return $this->cached; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             case 'compiler': | 
					
						
							|  |  |  |                 $this->smarty->loadPlugin($this->source->compiler_class); | 
					
						
							|  |  |  |                 $this->compiler = new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class, $this->smarty); | 
					
						
							| 
									
										
										
										
											2013-07-14 22:15:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 return $this->compiler; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             // FIXME: routing of template -> smarty attributes
 | 
					
						
							|  |  |  |             default: | 
					
						
							|  |  |  |                 if (property_exists($this->smarty, $property_name)) { | 
					
						
							|  |  |  |                     return $this->smarty->$property_name; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         throw new SmartyException("template property '$property_name' does not exist."); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-03-31 16:23:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-08 15:15:41 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * Template data object destrutor | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-03-08 15:15:41 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public function __destruct() | 
					
						
							| 
									
										
										
										
											2010-03-08 15:15:41 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) { | 
					
						
							|  |  |  |             $this->cached->handler->releaseLock($this->smarty, $this->cached); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-03-16 23:57:04 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2009-03-22 16:09:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  | } |