示例#1
0
 static function load($template_name, $vars = array())
 {
     Extract($vars);
     $template_path = Locate_Template($template_name);
     Ob_Start();
     if (!empty($template_path)) {
         include $template_path;
     } else {
         include SPrintF('%s/templates/%s', Core::$plugin_folder, $template_name);
     }
     return Ob_Get_Clean();
 }
示例#2
0
 public function Render_Gallery($template_file)
 {
     # Uses template filter
     $template_file = Apply_Filters('fancy_gallery_template', $template_file);
     # If there is no valid template file we bail out
     if (!Is_File($template_file)) {
         $template_file = $this->Get_Default_Template();
     }
     # Load template
     Ob_Start();
     include $template_file;
     $code = Ob_Get_Clean();
     # Strip Whitespaces
     $code = PReg_Replace('/\\s+/', ' ', $code);
     $code = Str_Replace('> <', '><', $code);
     $code = Trim($code);
     # Return
     return $code;
 }