Changeset 850

Show
Ignore:
Timestamp:
09/17/07 18:26:25 (15 months ago)
Author:
freakerz
Message:

Themes::get_all() used to work only on the first call.

Once self::$all_themes was set, it would try to work with $themes, which was not set prior.

Now all it does is if it exists, return it, kthxbye.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/themes.php

    r793 r850  
    1414    public static function get_all() 
    1515    { 
    16         if ( ! isset( self::$all_themes )) { 
     16        if ( !isset( self::$all_themes ) ) { 
    1717            $themes= glob( HABARI_PATH . '/user/themes/*', GLOB_ONLYDIR | GLOB_MARK ); 
    1818            if( Site::is('multi') ) { 
     
    2222                } 
    2323            } 
     24            $themes= array_filter( $themes, create_function('$a', 'return file_exists($a . "/theme.xml");') ); 
     25            $themefiles= array_map('basename', $themes); 
     26            self::$all_themes= array_combine($themefiles, $themes); 
    2427        } 
    25         $themes= array_filter( $themes, create_function('$a', 'return file_exists($a . "/theme.xml");') ); 
    26         $themefiles= array_map('basename', $themes); 
    27         self::$all_themes= array_combine($themefiles, $themes); 
    2828        return self::$all_themes; 
    2929    }