/**
  * Allows to override template source with addons
  * @param \Smarty_Template_Source   $source
  * @param \Smarty_Internal_Template $_template
  */
 public function populate(\Smarty_Template_Source $source, \Smarty_Internal_Template $_template = null)
 {
     $overridden_resource = fn_addon_template_overrides($source->resource, $_template);
     if ($overridden_resource != $source->resource) {
         $source->unique_resource = str_replace($source->resource, $overridden_resource, $source->unique_resource);
         $source->name = $overridden_resource;
         $source->resource = $overridden_resource;
     }
     return parent::populate($source, $_template);
 }
Esempio n. 2
0
 /**
  * build template filepath by traversing the template_dir array
  *
  * @param Smarty_Template_Source   $source    source object
  * @param Smarty_Internal_Template $_template template object
  * @return string fully qualified filepath
  * @throws SmartyException if default template handler is registered but not callable
  */
 protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
 {
     $file = $source->name;
     $hit = false;
     foreach ($source->smarty->getTemplateDir() as $_directory) {
         $_filePath = $_directory . $file;
         if ($this->fileExists($source, $_filePath)) {
             if ($hit) {
                 return $_filePath;
             }
             $hit = true;
         }
     }
     return parent::buildFilepath($source, $_template);
 }
Esempio n. 3
0
 /**
  * populate Source Object with meta data from Resource
  *
  * @param Smarty_Template_Source   $source    source object
  * @param Smarty_Internal_Template $_template template object
  */
 public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
 {
     $source->name = E::ModulePlugin()->GetDelegate('template', $source->name);
     parent::populate($source, $_template);
 }
Esempio n. 4
0
 public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
 {
     parent::populate($source, $_template);
     $source->recompiled = true;
 }