Beispiel #1
0
 /**
  * Returns the theme dir and path information
  * @return array An array of Theme data
  **/
 public static function get_all()
 {
     if (!isset(self::$all_themes)) {
         $dirs = array(HABARI_PATH . '/system/themes/*', HABARI_PATH . '/3rdparty/themes/*', HABARI_PATH . '/user/themes/*');
         if (Site::is('multi')) {
             $dirs[] = Site::get_dir('config') . '/themes/*';
         }
         $themes = array();
         foreach ($dirs as $dir) {
             $themes = array_merge($themes, Utils::glob($dir, GLOB_ONLYDIR | GLOB_MARK));
         }
         $themes = array_filter($themes, create_function('$a', 'return file_exists( $a . "/theme.xml" );'));
         $themefiles = array_map('basename', $themes);
         self::$all_themes = array_combine($themefiles, $themes);
     }
     return self::$all_themes;
 }