diff options
author | friendica <info@friendica.com> | 2012-02-23 20:29:09 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-02-23 20:29:09 -0800 |
commit | 44c23cda8edcde0ad6f904b8333f563b6d5ebc39 (patch) | |
tree | 1c65d976ad15e925c3e2de3dc7e172f5ba42fc30 /mod/settings.php | |
parent | 65ddefe9c5db4f5af9495377cd7e4463e8f68ef6 (diff) | |
download | volse-hubzilla-44c23cda8edcde0ad6f904b8333f563b6d5ebc39.tar.gz volse-hubzilla-44c23cda8edcde0ad6f904b8333f563b6d5ebc39.tar.bz2 volse-hubzilla-44c23cda8edcde0ad6f904b8333f563b6d5ebc39.zip |
theme shakeup commences - themes are now administered in admin panel.
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; |