コード例 #1
0
 function GenTpl2($tpl_tag = null, $load_js = true)
 {
     static $tpl_funcs = array('file' => array(), 'cat' => array());
     if (empty($tpl_tag)) {
         $tpl_tag = 'default';
     }
     if ($load_js) {
         WPFB_Core::$load_js = true;
     }
     $type = $this->is_file ? 'file' : 'cat';
     if (empty($tpl_funcs[$type][$tpl_tag])) {
         $parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file ? 'file' : 'cat', $tpl_tag);
         if (empty($parsed_tpl)) {
             return "Template {$type} :: {$tpl_tag} does not exist!";
         }
         $tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
     }
     self::$tpl_uid = defined('DOING_AJAX') && DOING_AJAX ? $this->GetId() . '' . round(microtime() * 1000) % 1000 : self::$tpl_uid + 1;
     return $tpl_funcs[$type][$tpl_tag]($this);
 }
コード例 #2
0
ファイル: Item.php プロジェクト: Seravo/WP-Filebase
 function GenTpl2($tpl_tag = null, $load_js = true)
 {
     static $tpl_funcs = array('file' => array(), 'cat' => array());
     if (empty($tpl_tag)) {
         $tpl_tag = 'default';
     }
     if ($load_js) {
         WPFB_Core::$load_js = true;
     }
     $type = $this->is_file ? 'file' : 'cat';
     if (empty($tpl_funcs[$type][$tpl_tag])) {
         $parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file ? 'file' : 'cat', $tpl_tag);
         if (empty($parsed_tpl)) {
             return "Template {$type} :: {$tpl_tag} does not exist!";
         }
         $tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
     }
     self::$tpl_uid++;
     return $tpl_funcs[$type][$tpl_tag]($this);
 }