diff options
Diffstat (limited to 'view/theme/redbasic/php/config.php')
-rw-r--r-- | view/theme/redbasic/php/config.php | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index c5c2be5df..be021e85c 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -3,8 +3,9 @@ function theme_content(&$a) { if(!local_user()) { return;} + $schema = get_pconfig(local_user(),'redbasic', 'schema' ); $nav_colour = get_pconfig(local_user(),'redbasic', 'nav_colour' ); - $background_colour = get_pconfig(local_user(),'redbasic', 'background_colour' ); + $bgcolour = get_pconfig(local_user(),'redbasic', 'bgcolour' ); $background_image = get_pconfig(local_user(),'redbasic', 'background_image' ); $item_colour = get_pconfig(local_user(),'redbasic', 'item_colour' ); $item_opacity = get_pconfig(local_user(),'redbasic', 'item_opacity' ); @@ -12,7 +13,7 @@ function theme_content(&$a) { $font_colour = get_pconfig(local_user(),'redbasic', 'font_colour' ); $radius = get_pconfig(local_user(),'redbasic', 'radius' ); $shadow = get_pconfig(local_user(),'redbasic', 'photo_shadow' ); - return redbasic_form($a, $nav_colour, $background_colour, $background_image, $item_colour, $item_opacity, + return redbasic_form($a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity, $font_size, $font_colour, $radius, $shadow); } @@ -20,6 +21,7 @@ function theme_post(&$a) { if(!local_user()) { return;} if (isset($_POST['redbasic-settings-submit'])) { + set_pconfig(local_user(), 'redbasic', 'schema', $_POST['redbasic_schema']); set_pconfig(local_user(), 'redbasic', 'nav_colour', $_POST['redbasic_nav_colour']); set_pconfig(local_user(), 'redbasic', 'background_colour', $_POST['redbasic_background_colour']); set_pconfig(local_user(), 'redbasic', 'background_image', $_POST['redbasic_background_image']); @@ -32,22 +34,40 @@ function theme_post(&$a) { } } -function redbasic_form(&$a, $nav_colour, $background_colour, $background_image, $item_colour, $item_opacity, +function redbasic_form(&$a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity, $font_size, $font_colour, $radius, $shadow) { + $scheme_choices = array(); + $scheme_choices["---"] = t("Default"); + $files = glob('view/theme/' . current_theme() . '/schema/*'); + if($files) { + foreach($files as $file) { + $f = basename($file, ".php"); + $scheme_name = $f; + $scheme_choices[$f] = $scheme_name; + } + } + + $nav_colours = array ( + '' => 'Scheme Default', 'red' => 'red', 'black' => 'black', 'silver' => 'silver', ); +if(feature_enabled(local_user(),'expert')) + $expert = 1; + $t = get_markup_template('theme_settings.tpl'); $o .= replace_macros($t, array( '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), + '$expert' => $expert, '$title' => t("Theme settings"), + '$schema' => array('redbasic_schema', t('Set scheme'), $schema, '', $scheme_choices), '$nav_colour' => array('redbasic_nav_colour', t('Navigation bar colour'), $nav_colour, '', $nav_colours), - '$background_colour' => array('redbasic_background_colour', t('Set the background colour'), $background_colour), + '$bgcolour' => array('redbasic_background_colour', t('Set the background colour'), $bgcolour), '$background_image' => array('redbasic_background_image', t('Set the background image'), $background_image), '$item_colour' => array('redbasic_item_colour', t('Set the background colour of items'), $item_colour), '$item_opacity' => array('redbasic_item_opacity', t('Set the opacity of items'), $item_opacity), |