示例#1
0
 /**
  * Check template is exists
  * 
  * @param string $resource_name resource name
  * @param string $theme_type theme type
  * @param string $module module guid
  * @return boolean
  */
 public function template_exists($resource_name, $theme_type = null, $module = null)
 {
     if (!isset($module)) {
         return parent::template_exists($resource_name);
     }
     if (!isset($this->CI)) {
         $this->CI =& get_instance();
     }
     $module_name = $module === true ? $this->CI->router->class : $module;
     $theme_data = $this->CI->pg_theme->format_theme_settings($module_name, $theme_type);
     if (strpos($resource_name, '.') === false) {
         $resource_name .= '.tpl';
     }
     if ($module !== false) {
         if (file_exists(SITE_PHYSICAL_PATH . $theme_data["theme_module_path"] . $resource_name)) {
             $path = SITE_PHYSICAL_PATH . $theme_data["theme_module_path"] . $resource_name;
         } else {
             $path = SITE_PHYSICAL_PATH . $theme_data["theme_path"] . $resource_name;
         }
     } else {
         $path = SITE_PHYSICAL_PATH . $theme_data["theme_path"] . $resource_name;
     }
     return file_exists($path);
 }