Make idiot mode colour schemes work.
This commit is contained in:
parent
f961251176
commit
9834df13c9
@ -15,7 +15,8 @@ function theme_content(&$a) {
|
|||||||
$linkcolour = get_pconfig(local_user(), 'redbasic', 'linkcolour');
|
$linkcolour = get_pconfig(local_user(), 'redbasic', 'linkcolour');
|
||||||
$iconset = get_pconfig(local_user(), 'redbasic', 'iconset');
|
$iconset = get_pconfig(local_user(), 'redbasic', 'iconset');
|
||||||
$shiny = get_pconfig(local_user(), 'redbasic', 'shiny');
|
$shiny = get_pconfig(local_user(), 'redbasic', 'shiny');
|
||||||
return redbasic_form($a, $font_size, $line_height, $colour, $shadow, $navcolour, $opaquenav, $displaystyle, $linkcolour, $iconset, $shiny);
|
$colour_scheme = get_pconfig(local_user(), 'redbasic', 'colour_scheme');
|
||||||
|
return redbasic_form($a, $font_size, $line_height, $colour, $shadow, $navcolour, $opaquenav, $displaystyle, $linkcolour, $iconset, $shiny, $colour_scheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
function theme_post(&$a) {
|
function theme_post(&$a) {
|
||||||
@ -31,6 +32,7 @@ function theme_post(&$a) {
|
|||||||
set_pconfig(local_user(), 'redbasic', 'linkcolour', $_POST['redbasic_linkcolour']);
|
set_pconfig(local_user(), 'redbasic', 'linkcolour', $_POST['redbasic_linkcolour']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'iconset', $_POST['redbasic_iconset']);
|
set_pconfig(local_user(), 'redbasic', 'iconset', $_POST['redbasic_iconset']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'shiny', $_POST['redbasic_shiny']);
|
set_pconfig(local_user(), 'redbasic', 'shiny', $_POST['redbasic_shiny']);
|
||||||
|
set_pconfig(local_user(), 'redbasic', 'colour_scheme', $_POST['redbasic_colour_scheme']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +67,7 @@ function theme_post(&$a) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
// These aren't all used yet, but they're not bloat - we'll use drop down menus in idiot mode.
|
// These aren't all used yet, but they're not bloat - we'll use drop down menus in idiot mode.
|
||||||
function redbasic_form(&$a, $font_size, $line_height, $colour, $shadow, $navcolour, $opaquenav, $displaystyle, $linkcolour, $iconset, $shiny) {
|
function redbasic_form(&$a, $font_size, $line_height, $colour, $shadow, $navcolour, $opaquenav, $displaystyle, $linkcolour, $iconset, $shiny, $colour_scheme) {
|
||||||
$line_heights = array(
|
$line_heights = array(
|
||||||
"1.3" => "1.3",
|
"1.3" => "1.3",
|
||||||
"---" => "---",
|
"---" => "---",
|
||||||
|
@ -34,8 +34,14 @@
|
|||||||
$displaystyle = get_pconfig(local_user(), "redbasic", "displaystyle");
|
$displaystyle = get_pconfig(local_user(), "redbasic", "displaystyle");
|
||||||
$linkcolour = get_pconfig(local_user(), "redbasic", "linkcolour");
|
$linkcolour = get_pconfig(local_user(), "redbasic", "linkcolour");
|
||||||
$shiny = get_pconfig(local_user(), "redbasic", "shiny");
|
$shiny = get_pconfig(local_user(), "redbasic", "shiny");
|
||||||
|
if (! feature_enabled(local_user(),'expert')) {$colour_scheme = get_pconfig(local_user(), "redbasic", "colour_scheme");}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In non-expert mode, we just let them choose font size, line height, and a colour scheme. A colour scheme is just a pre-defined set of the above variables.
|
||||||
|
// But only apply these settings in non-expert mode to prevent confusion when turning expert mode on and off.
|
||||||
|
if(! feature_enabled(local_user(),'expert')) {
|
||||||
|
if ($colour_scheme === 'fancyred') {$shadows = true; $navcolour = 'black'; $shadows = true; $displaystyle = 'fancy'; $linkcolour = 'f00'; $shiny = "opaque";}
|
||||||
|
}
|
||||||
|
|
||||||
// This is probably the easiest place to apply global settings. Don't bother with site line height and such. Instead, check pconfig for global user settings.
|
// This is probably the easiest place to apply global settings. Don't bother with site line height and such. Instead, check pconfig for global user settings.
|
||||||
// eg, if ($redbasic_font_size === false) {$redbasic_font_size = get_pconfig(local_user(), "global", "font_size"); If it's not set, we'll just use the CSS with no changes.
|
// eg, if ($redbasic_font_size === false) {$redbasic_font_size = get_pconfig(local_user(), "global", "font_size"); If it's not set, we'll just use the CSS with no changes.
|
||||||
@ -64,7 +70,7 @@
|
|||||||
}
|
}
|
||||||
echo "\r\n";
|
echo "\r\n";
|
||||||
|
|
||||||
// use $colour_scheme (not yet implemented) for idiot mode.
|
// use $colour_scheme for idiot mode.
|
||||||
if($colour === "dark") {if (file_exists('view/theme/' . current_theme() . '/css/dark.css')) {
|
if($colour === "dark") {if (file_exists('view/theme/' . current_theme() . '/css/dark.css')) {
|
||||||
$dark = (file_get_contents('view/theme/' . current_theme() . '/css/dark.css'));
|
$dark = (file_get_contents('view/theme/' . current_theme() . '/css/dark.css'));
|
||||||
echo "$dark";}
|
echo "$dark";}
|
||||||
|
Reference in New Issue
Block a user