commit c7d3ac08e5728fd3610cbd50833802ff47915b6b
parent 9ba797cebf5a750c088b441a4497295c6e47eafa
Author: Jan Dankert <devnull@localhost>
Date: Fri, 28 Sep 2012 23:54:31 +0200
User-Styles aus der Konfiguration erzeugen.
Diffstat:
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/model/User.class.php b/model/User.class.php
@@ -1045,31 +1045,15 @@ SQL
/**
* Ermitteln aller zur Verfuegung stehenden Stylesheets
*/
- function getAvailableStyles()
+ public function getAvailableStyles()
{
- global $conf_themedir;
-
- $allstyles = array();
+ global $conf;
+ $styles = array();
- // Theme-Verzeichnis nach "*.css"-Dateien durchsuchen.
- $dir = $conf_themedir.'/css/user';
- $handle = @opendir( $dir );
-
- if ( !is_resource($handle) )
- Http::serverError('Cannot open CSS dir: '.$dir);
-
- while ($file = readdir ($handle))
- {
- if ( substr($file,-4)=='.css' && substr($file,0,4) != 'base' )
- {
- $file = substr($file,0,-4);
- $allstyles[$file] = ucwords($file);
- }
- }
- closedir($handle);
+ foreach( $conf['style'] as $key=>$values)
+ $styles[$key] = $values['name'];
- asort($allstyles); // Alphabetisch sortieren.
- return $allstyles;
+ return $styles;
}