From 3891b605fe28d89c61bf03cdd70eac5de08f2d76 Mon Sep 17 00:00:00 2001 From: marijus Date: Thu, 10 Oct 2013 12:59:41 +0200 Subject: get rid of the clean font because it looks weird in some browsers --- view/theme/redbasic/css/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/theme') diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 135a4d3c3..28dc12038 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -8,7 +8,7 @@ /* generals */ body { - font-family: arial,freesans,clean,sans-serif; + font-family: arial,freesans,sans-serif; font-size: 12px; background-color: #$background_colour; background-image: url('$background_image'); @@ -18,7 +18,7 @@ body { margin: 0px; } .jslider { - font-family: arial,freesans,clean,sans-serif; + font-family: arial,freesans,sans-serif; } abbr { -- cgit v1.2.3 From 41838fdfad93e6bbee54f27350f611b4c5b7e403 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 10 Oct 2013 18:39:28 +0100 Subject: Basic schema support - but no actual schemas. --- view/theme/redbasic/php/config.php | 19 +++++++++++++++++-- view/theme/redbasic/php/style.php | 22 +++++++++++++++++++++- view/theme/redbasic/tpl/theme_settings.tpl | 7 +++++++ 3 files changed, 45 insertions(+), 3 deletions(-) (limited to 'view/theme') diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index c5c2be5df..d75203a79 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -3,6 +3,7 @@ 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' ); $background_image = get_pconfig(local_user(),'redbasic', 'background_image' ); @@ -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, $background_colour, $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,9 +34,21 @@ 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, $background_colour, $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 ( 'red' => 'red', 'black' => 'black', @@ -46,6 +60,7 @@ function redbasic_form(&$a, $nav_colour, $background_colour, $background_image, '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), '$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), '$background_image' => array('redbasic_background_image', t('Set the background image'), $background_image), diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index cb17f8298..ad8dca9a2 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -29,6 +29,7 @@ $search_background = '#EEEEEE'; } +// Load the owners pconfig $background_colour = get_pconfig($uid, "redbasic", "background_colour"); $background_image = get_pconfig($uid, "redbasic", "background_image"); $item_colour = get_pconfig($uid, "redbasic", "item_colour"); @@ -36,8 +37,27 @@ $font_size = get_pconfig($uid, "redbasic", "font_size"); $font_colour = get_pconfig($uid, "redbasic", "font_colour"); $radius = get_pconfig($uid, "redbasic", "radius"); - $shadow = get_pconfig($uid,"redbasic","photo_shadow"); + $shadow = get_pconfig($uid,"redbasic","photo_shadow"); +// Now load the scheme. If a value is changed above, we'll keep the settings +// If not, we'll keep those defined by the schema +// Setting $scheme to '' wasn't working for some reason, so we'll check it's +// not --- like the mobile theme does instead. + + if (($schema) && ($schema != '---')) { + $schemefile = 'view/theme/' . current_theme() . '/schema/' . $schema . '.php'; + require_once ($schemefile); + } + +// If we haven't got a schema, load the default. We shouldn't touch this - we +// should leave it for admins to define for themselves. + if (! $schema) { + if(file_exists('view/theme/' . current_theme() . '/schema/default.php')) { + $schemefile = 'view/theme/' . current_theme() . '/schema/' . 'default.php'; + require_once ($schemefile); + } + } + //Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting //individually. If we don't, we'll have problems if a user has set one, but not all options. diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl index 412af5c44..426ee076d 100644 --- a/view/theme/redbasic/tpl/theme_settings.tpl +++ b/view/theme/redbasic/tpl/theme_settings.tpl @@ -1,3 +1,9 @@ +{{include file="field_select.tpl" field=$schema}} +
+ +
+ +{{if $expert}} {{include file="field_select.tpl" field=$nav_colour}} {{include file="field_input.tpl" field=$background_colour}} {{include file="field_input.tpl" field=$background_image}} @@ -11,3 +17,4 @@
+{{/if}} \ No newline at end of file -- cgit v1.2.3 From d05899fb5014db3d86e34788aaac609f80e659f5 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 10 Oct 2013 18:42:21 +0100 Subject: But remember to set the expert flag --- view/theme/redbasic/php/config.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'view/theme') diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index d75203a79..deadbe2b1 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -55,10 +55,14 @@ function redbasic_form(&$a, $schema, $nav_colour, $background_colour, $backgroun '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), -- cgit v1.2.3 From cdf608898a1371a0dd5071d72e95944d809e2d79 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 10 Oct 2013 19:18:33 +0100 Subject: Various schema issues. --- view/theme/redbasic/css/style.css | 8 ++++---- view/theme/redbasic/php/config.php | 8 ++++---- view/theme/redbasic/php/style.php | 26 +++++++++++++------------- view/theme/redbasic/tpl/theme_settings.tpl | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'view/theme') diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 28dc12038..b460d7e89 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -10,11 +10,11 @@ body { font-family: arial,freesans,sans-serif; font-size: 12px; - background-color: #$background_colour; + background-color: $bgcolour; background-image: url('$background_image'); background-attachment: fixed; background-size: cover; - color: #$font_colour; + color: $font_colour; margin: 0px; } .jslider { @@ -117,7 +117,7 @@ blockquote { filter:alpha(opacity=100); } -nav {background-image: linear-gradient(bottom, #$nav_bg_1 26%, #$nav_bg_2 82%); +nav {background-image: linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); background-image: -o-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); background-image: -moz-linear-gradient(bottom,$nav_bg_1 26%, $nav_bg_2 82%); background-image: -webkit-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); @@ -823,7 +823,7 @@ footer { margin-top: 10px; position: relative; border-radius: $radiuspx; - background-color: #$item_colour; + background-color: $item_colour; opacity: $item_opacity; } diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index deadbe2b1..4455cc427 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -5,7 +5,7 @@ function theme_content(&$a) { $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' ); @@ -13,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, $schema, $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); } @@ -34,7 +34,7 @@ function theme_post(&$a) { } } -function redbasic_form(&$a, $schema, $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(); @@ -66,7 +66,7 @@ if(feature_enabled(local_user(),'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), diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index ad8dca9a2..738f98726 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -30,7 +30,7 @@ } // Load the owners pconfig - $background_colour = get_pconfig($uid, "redbasic", "background_colour"); + $bgcolour = get_pconfig($uid, "redbasic", "background_colour"); $background_image = get_pconfig($uid, "redbasic", "background_image"); $item_colour = get_pconfig($uid, "redbasic", "item_colour"); $item_opacity = get_pconfig($uid, "redbasic", "item_opacity"); @@ -47,15 +47,15 @@ if (($schema) && ($schema != '---')) { $schemefile = 'view/theme/' . current_theme() . '/schema/' . $schema . '.php'; require_once ($schemefile); - } - -// If we haven't got a schema, load the default. We shouldn't touch this - we -// should leave it for admins to define for themselves. - if (! $schema) { - if(file_exists('view/theme/' . current_theme() . '/schema/default.php')) { - $schemefile = 'view/theme/' . current_theme() . '/schema/' . 'default.php'; - require_once ($schemefile); - } + + // If we haven't got a schema, load the default. We shouldn't touch this - we + // should leave it for admins to define for themselves. + if (! $schema) { + if(file_exists('view/theme/' . current_theme() . '/schema/default.php')) { + $schemefile = 'view/theme/' . current_theme() . '/schema/' . 'default.php'; + require_once ($schemefile); + } + } } //Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting @@ -68,8 +68,8 @@ $nav_bg_3 = "#f00"; $nav_bg_4 = "#b00"; } - if (! $background_colour) - $background_colour = "fff"; + if (! $bgcolour) + $bgcolour = "fff"; if (! $background_image) $background_image =''; if (! $item_colour) @@ -97,7 +97,7 @@ $options = array ( '$nav_bg_3' => $nav_bg_3, '$nav_bg_4' => $nav_bg_4, '$search_background' => $search_background, -'$background_colour' => $background_colour, +'$bgcolour' => $bgcolour, '$background_image' => $background_image, '$item_colour' => $item_colour, '$item_opacity' => $item_opacity, diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl index 426ee076d..45dd529fa 100644 --- a/view/theme/redbasic/tpl/theme_settings.tpl +++ b/view/theme/redbasic/tpl/theme_settings.tpl @@ -5,7 +5,7 @@ {{if $expert}} {{include file="field_select.tpl" field=$nav_colour}} -{{include file="field_input.tpl" field=$background_colour}} +{{include file="field_input.tpl" field=$bgcolour}} {{include file="field_input.tpl" field=$background_image}} {{include file="field_input.tpl" field=$item_colour}} {{include file="field_input.tpl" field=$item_opacity}} -- cgit v1.2.3 From 6d85acc4134bccf47c847709f3b27fe6e663b064 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 10 Oct 2013 19:22:28 +0100 Subject: *sigh* I swear I DID test this first... --- view/theme/redbasic/php/style.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/theme') diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 738f98726..0245680d7 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -47,7 +47,7 @@ if (($schema) && ($schema != '---')) { $schemefile = 'view/theme/' . current_theme() . '/schema/' . $schema . '.php'; require_once ($schemefile); - + } // If we haven't got a schema, load the default. We shouldn't touch this - we // should leave it for admins to define for themselves. if (! $schema) { @@ -56,7 +56,7 @@ require_once ($schemefile); } } - } + //Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting //individually. If we don't, we'll have problems if a user has set one, but not all options. -- cgit v1.2.3 From 9533ea995c79556faecd2ed34585452e01aca290 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 10 Oct 2013 22:14:18 +0100 Subject: Add "scheme default" button for nav colours. --- view/theme/redbasic/php/config.php | 1 + 1 file changed, 1 insertion(+) (limited to 'view/theme') diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index 4455cc427..be021e85c 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -50,6 +50,7 @@ function redbasic_form(&$a, $schema, $nav_colour, $bgcolour, $background_image, $nav_colours = array ( + '' => 'Scheme Default', 'red' => 'red', 'black' => 'black', 'silver' => 'silver', -- cgit v1.2.3