예제 #1
0
function smarty_resource_framework_get_file($tpl_name)
{
    $module = null;
    if (preg_match('/\\+/', $tpl_name)) {
        list($module, $tpl_name) = explode('+', $tpl_name);
    }
    return Framework_Template::getPath($tpl_name, $module) . '/' . $tpl_name;
}
예제 #2
0
 /**
  * display
  *
  * @access public
  * @return void
  */
 public function display()
 {
     $path = Framework_Template::getPath($this->module->tplFile, Framework::$request->module);
     $this->template->assign('modulePath', $path);
     $this->template->assign('site', Framework::$site);
     $this->template->assign('tplFile', $this->module->tplFile);
     $this->template->assign('user', $this->user);
     $this->template->assign('session', $this->session);
     foreach ($this->module->getData() as $var => $val) {
         if (!in_array($var, array('path', 'tplFile'))) {
             $this->template->assign($var, $val);
         }
     }
     if ($this->module->pageTemplateFile == null) {
         $pageTemplateFile = 'page.tpl';
     } else {
         $pageTemplateFile = $this->module->pageTemplateFile;
     }
     $this->template->display($pageTemplateFile);
 }
예제 #3
0
 /**
  * setPaths
  *
  * @access      public
  * @param       string      $template
  * @return      void
  */
 protected function setPaths($template)
 {
     $this->template_dir = Framework_Template::getPath($template, $this->module, $this->template);
     $path = realpath(Framework::$site->getPath() . '/Templates/' . $this->template);
     $this->compile_dir = $path . '/templates_c';
     $this->cache_dir = $path . '/cache';
     $this->config_dir = $path . '/config';
     $this->plugins_dir = array_merge($this->plugins_dir, array('Framework/Template/Smarty/plugins', 'plugins', $path . '/plugins'));
     if (!is_writeable($this->compile_dir) || !is_writeable($this->cache_dir)) {
         throw new Framework_Exception('Cannot write to template cache/compile dirs: ' . $path);
     }
 }