コード例 #1
0
ファイル: Resource.php プロジェクト: rmaiwald/core
 /**
  * Resource function to load a resource located inside the plugins folders.
  *
  * @param Zikula_View $view Reference to Smarty instance.
  * @param string      $type Type of the resource.
  * @param string      $name Name of the resource.
  *
  * @access private
  * @return boolean
  */
 public static function load($view, $type, $name)
 {
     if (isset(self::$cache[$type][$name])) {
         return self::$cache[$type][$name];
     }
     self::$cache[$type][$name] = false;
     foreach ((array) $view->plugins_dir as $_plugin_dir) {
         $filepath = "{$_plugin_dir}/{$type}.{$name}.php";
         if (@is_readable($filepath)) {
             include_once $filepath;
             if (!function_exists("smarty_{$type}_{$name}")) {
                 $view->_trigger_fatal_error(__f('[View %1$s] \'%2$s\' is not implemented', array($type, $name)), null, null, __FILE__, __LINE__);
                 return false;
             }
             self::$cache[$type][$name] = true;
             break;
         }
     }
     return self::$cache[$type][$name];
 }