diff options
Diffstat (limited to 'view/theme/redbasic/php')
-rw-r--r-- | view/theme/redbasic/php/config.php | 11 | ||||
-rw-r--r-- | view/theme/redbasic/php/style.php | 60 |
2 files changed, 41 insertions, 30 deletions
diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index be021e85c..053940219 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' ); - $bgcolour = get_pconfig(local_user(),'redbasic', 'bgcolour' ); + $bgcolour = get_pconfig(local_user(),'redbasic', 'background_colour' ); $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,8 +13,9 @@ 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' ); + $section_width=get_pconfig(local_user(),"redbasic","section_width"); return redbasic_form($a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity, - $font_size, $font_colour, $radius, $shadow); + $font_size, $font_colour, $radius, $shadow, $section_width); } function theme_post(&$a) { @@ -31,15 +32,16 @@ function theme_post(&$a) { set_pconfig(local_user(), 'redbasic', 'font_colour', $_POST['redbasic_font_colour']); set_pconfig(local_user(), 'redbasic', 'radius', $_POST['redbasic_radius']); set_pconfig(local_user(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']); + set_pconfig(local_user(), 'redbasic', 'section_width', $_POST['redbasic_section_width']); } } function redbasic_form(&$a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity, - $font_size, $font_colour, $radius, $shadow) { + $font_size, $font_colour, $radius, $shadow, $section_width) { $scheme_choices = array(); $scheme_choices["---"] = t("Default"); - $files = glob('view/theme/' . current_theme() . '/schema/*'); + $files = glob('view/theme/redbasic/schema/*.php'); if($files) { foreach($files as $file) { $f = basename($file, ".php"); @@ -75,6 +77,7 @@ if(feature_enabled(local_user(),'expert')) '$font_colour' => array('redbasic_font_colour', t('Set font-colour for posts and comments'), $font_colour), '$radius' => array('redbasic_radius', t('Set radius of corners'), $radius), '$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $shadow), + '$section_width' => array('redbasic_section_width',t('Set width of main section'),$section_width), )); return $o; diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index b80a3e764..c4bd2e15a 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -1,5 +1,4 @@ <?php - // Get the UID of the channel owner $uid = get_theme_uid(); @@ -11,25 +10,6 @@ // A further two - $nav_bg_3 and $nav_bg_4 are used to create the hover, if any particular scheme // wants to implement that $nav_colour = get_pconfig($uid, "redbasic", "nav_colour"); - if ($nav_colour == "red") { - $nav_bg_1 = "#f88"; - $nav_bg_2 = "#b00"; - $nav_bg_3 = "#f00"; - $nav_bg_4 = "#b00"; - $search_background = '#FFDDDD'; - $active_colour = '#444444'; - } - - if ($nav_colour == "black") { - $nav_bg_1 = $nav_bg_3 = "#000"; - $nav_bg_2 = $nav_bg_4 = "#222"; - $search_background = '#EEEEEE'; - $active_colour = '#AAAAAA'; - } - if ($nav_colour == "silver") { - $nav_bg_1 = $nav_bg_2 = $nav_bg_3 = $nav_bg_4 = "silver"; - $search_background = '#EEEEEE'; - } // Load the owners pconfig $schema = get_pconfig($uid,'redbasic','schema'); @@ -41,6 +21,7 @@ $font_colour = get_pconfig($uid, "redbasic", "font_colour"); $radius = get_pconfig($uid, "redbasic", "radius"); $shadow = get_pconfig($uid,"redbasic","photo_shadow"); + $section_width=get_pconfig($uid,"redbasic","section_width"); // 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 @@ -48,14 +29,14 @@ // not --- like the mobile theme does instead. if (($schema) && ($schema != '---')) { - $schemefile = 'view/theme/' . current_theme() . '/schema/' . $schema . '.php'; + $schemefile = 'view/theme/redbasic/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'; + if(file_exists('view/theme/redbasic/schema/default.php')) { + $schemefile = 'view/theme/redbasic/schema/' . 'default.php'; require_once ($schemefile); } } @@ -89,11 +70,37 @@ $shadow = "0"; if(! $active_colour) $active_colour = '#FFFFFF'; + if (! $section_width) + $section_width="72%"; + + +// Nav colours have nested values, so we have to define the actual variables +// used in the CSS from the higher level "red", "black", etc here + if ($nav_colour == "red") { + $nav_bg_1 = "#f88"; + $nav_bg_2 = "#b00"; + $nav_bg_3 = "#f00"; + $nav_bg_4 = "#b00"; + $search_background = '#FFDDDD'; + $active_colour = '#444444'; + } + if ($nav_colour == "black") { + $nav_bg_1 = $nav_bg_3 = "#000"; + $nav_bg_2 = $nav_bg_4 = "#222"; + $search_background = '#EEEEEE'; + $active_colour = '#AAAAAA'; + } + if ($nav_colour == "silver") { + $nav_bg_1 = $nav_bg_2 = $nav_bg_3 = $nav_bg_4 = "silver"; + $search_background = '#EEEEEE'; + } + + // Apply the settings - if(file_exists('view/theme/' . current_theme() . '/css/style.css')) { - $x = file_get_contents('view/theme/' . current_theme() . '/css/style.css'); + if(file_exists('view/theme/redbasic/css/style.css')) { + $x = file_get_contents('view/theme/redbasic/css/style.css'); $options = array ( '$nav_bg_1' => $nav_bg_1, @@ -109,7 +116,8 @@ $options = array ( '$font_colour' => $font_colour, '$radius' => $radius, '$shadow' => $shadow, -'$active_colour' => $active_colour +'$active_colour' => $active_colour, +'$section_width' => $section_width ); echo str_replace(array_keys($options), array_values($options), $x); |