diff options
author | Michael <icarus@dabo.de> | 2012-02-26 21:47:47 +0100 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-02-26 21:47:47 +0100 |
commit | 437e18d7a7433ea5a9e3388c39ba32c7fe25eb18 (patch) | |
tree | 747449ae089f3dd3f6bb55afdf93fa79081bd564 /mod/settings.php | |
parent | edc44933a4f57c09ee1cfb93615d052a2b125d99 (diff) | |
parent | 2081e6d507d5983f802c1024cf1e38c6d06d6067 (diff) | |
download | volse-hubzilla-437e18d7a7433ea5a9e3388c39ba32c7fe25eb18.tar.gz volse-hubzilla-437e18d7a7433ea5a9e3388c39ba32c7fe25eb18.tar.bz2 volse-hubzilla-437e18d7a7433ea5a9e3388c39ba32c7fe25eb18.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/settings.php')
-rwxr-xr-x | mod/settings.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/mod/settings.php b/mod/settings.php index 57a4e6db0..91f4325da 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -210,7 +210,7 @@ function settings_post(&$a) { } } - $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); + $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->user['theme']); $username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : ''); $email = ((x($_POST,'email')) ? notags(trim($_POST['email'])) : ''); $timezone = ((x($_POST,'timezone')) ? notags(trim($_POST['timezone'])) : ''); @@ -728,13 +728,23 @@ function settings_content(&$a) { $default_theme = get_config('system','theme'); if(! $default_theme) $default_theme = 'default'; + + $allowed_themes_str = get_config('system','allowed_themes'); + $allowed_themes_raw = explode(',',$allowed_themes_str); + $allowed_themes = array(); + if(count($allowed_themes_raw)) + foreach($allowed_themes_raw as $x) + if(strlen(trim($x))) + $allowed_themes[] = trim($x); + $themes = array(); $files = glob('view/theme/*'); - if($files) { - foreach($files as $file) { - $f = basename($file); - $is_experimental = file_exists($file . '/experimental'); + if($allowed_themes) { + foreach($allowed_themes as $th) { + $f = $th; + $is_experimental = file_exists('view/theme/' . $th . '/experimental'); + $unsupported = file_exists('view/theme/' . $th . '/unsupported'); if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ $theme_name = (($is_experimental) ? sprintf("%s - \x28Experimental\x29", $f) : $f); $themes[$f]=$theme_name; |