From 2c9c206808fec2212141f8630ce534ed29a47037 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 21 Sep 2013 19:23:21 +0100 Subject: Fix perms for viewing a channel --- mod/channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/channel.php b/mod/channel.php index 5a66f5e07..9fa4bbe80 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -114,7 +114,7 @@ function channel_content(&$a, $update = 0, $load = false) { $perms = get_all_perms($a->profile['profile_uid'],$ob_hash); - if(! $perms['view_stream']) { + if(! $perms['view_profile']) { notice( t('Permission denied.') . EOL); return; } -- cgit v1.2.3 From 5d3dbfae4c544a2f46ca9463461d537aa8940c73 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 1 Oct 2013 22:59:54 +0100 Subject: revert that --- mod/channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/channel.php b/mod/channel.php index 9fa4bbe80..5a66f5e07 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -114,7 +114,7 @@ function channel_content(&$a, $update = 0, $load = false) { $perms = get_all_perms($a->profile['profile_uid'],$ob_hash); - if(! $perms['view_profile']) { + if(! $perms['view_stream']) { notice( t('Permission denied.') . EOL); return; } -- cgit v1.2.3 From 3f850d346249e66e39f1e6646bfeb5e5f26b7150 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 1 Oct 2013 23:04:14 +0100 Subject: Do PCSS properly --- view/theme/redbasic/css/style.css | 26 ++- view/theme/redbasic/php/config.php | 173 ++++---------------- view/theme/redbasic/php/style.php | 199 +++++++---------------- view/theme/redbasic/tpl/basic_theme_settings.tpl | 14 -- view/theme/redbasic/tpl/theme_settings.tpl | 23 +-- 5 files changed, 117 insertions(+), 318 deletions(-) delete mode 100755 view/theme/redbasic/tpl/basic_theme_settings.tpl mode change 100755 => 100644 view/theme/redbasic/tpl/theme_settings.tpl diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index e973b9c7c..bc8014978 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -10,8 +10,11 @@ body { font-family: arial,freesans,clean,sans-serif; font-size: 12px; - background-color: #FFFFFF; - color: #000000; + background-color: #$background_colour; + background-image: url('$background_image'); + background-attachment: fixed; + background-size: cover; + color: #$font_colour; margin: 0px; } .jslider { @@ -114,6 +117,21 @@ blockquote { filter:alpha(opacity=100); } +nav {background-image: linear-gradient(bottom, #$nav_bg_1 26%, #$nav_bg_2 82%) !important; + background-image: -o-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%) !important; + background-image: -moz-linear-gradient(bottom,$nav_bg_1 26%, $nav_bg_2 82%) !important; + background-image: -webkit-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%) !important; + background-image: -ms-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%) !important; +} + + +nav:hover {background-image: linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); + background-image: -o-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); + background-image: -moz-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%) !important; + background-image: -webkit-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); + background-image: -ms-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); +} + nav #site-location { color: #888a85; @@ -805,7 +823,8 @@ footer { margin-top: 10px; position: relative; border-radius: $radiuspx; - border: 1px solid #eec; + background-color: #$item_colour; + opacity: $item_opacity; } .thread-end-wrapper { @@ -953,6 +972,7 @@ footer { .wall-item-content { margin-left: 10px; overflow: auto; + font-size: $font_sizepx; } .wall-item-content img { diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index 4e7363362..2502bb675 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -1,164 +1,57 @@ "1.3", - "---" => "---", - "1.6" => "1.6", - "1.5" => "1.5", - "1.4" => "1.4", - "1.2" => "1.2", - "1.1" => "1.1", - ); - $font_sizes = array( - '12' => '12', - '14' => '14', - "---" => "---", - "16" => "16", - "15" => "15", - '13.5' => '13.5', - '13' => '13', - '12.5' => '12.5', - '12' => '12', - ); - $colours = array( - 'light' => 'light', - 'dark' => 'dark', - ); - - $colour_schemes = array( - 'redbasic' => 'redbasic', - 'fancyred' => 'fancyred', - 'dark' => 'dark', - ); - $shadows = array( - 'true' => 'Yes', - 'false' => 'No', - ); +function redbasic_form(&$a, $nav_colour, $background_colour, $background_image, $item_colour, $item_opacity, + $font_size, $font_colour, $radius) { - $navcolours = array ( + $nav_colours = array ( 'red' => 'red', 'black' => 'black', - ); - - $displaystyles = array ( - 'fancy' => 'fancy', - 'classic' => 'classic', - ); - - $linkcolours = array ( - 'blue' => 'blue', - 'red' => 'red', - ); - - $iconsets = array ( - 'default' => 'default', - ); - - $shinys = array ( - 'none' => 'none', - 'opaque' => 'opaque', - ); - if(feature_enabled(local_user(),'expert')) { + ); + $t = get_markup_template('theme_settings.tpl'); $o .= replace_macros($t, array( '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), '$title' => t("Theme settings"), - '$font_size' => array('redbasic_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes), - '$line_height' => array('redbasic_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), - '$colour' => array('redbasic_colour', t('Set colour scheme'), $colour, '', $colours), - '$shadow' => array('redbasic_shadow', t('Draw shadows'), $shadow, '', $shadows), - '$navcolour' => array('redbasic_navcolour', t('Navigation bar colour'), $navcolour, '', $navcolours), - '$displaystyle' => array('redbasic_displaystyle', t('Display style'), $displaystyle, '', $displaystyles), - '$linkcolour' => array('redbasic_linkcolour', t('Display colour of links - hex value, do not include the #'), $linkcolour, '', $linkcolours), - '$iconset' => array('redbasic_iconset', t('Icons'), $iconset, '', $iconsets), - '$shiny' => array('redbasic_shiny', t('Shiny style'), $shiny, '', $shinys), - '$radius' => array('redbasic_radius', t('Corner radius'), $radius, t('0-99 default: 5')), - ));} - - if(! feature_enabled(local_user(),'expert')) { - $t = get_markup_template('basic_theme_settings.tpl'); - $o .= replace_macros($t, array( - '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(), - '$title' => t("Theme settings"), - '$font_size' => array('redbasic_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes), - '$line_height' => array('redbasic_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), - '$colour_scheme' => array('redbasic_colour_scheme', t('Set colour scheme'), $colour_scheme, '', $colour_schemes), - ));} - + '$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), + '$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), + '$font_size' => array('redbasic_font_size', t('Set font-size for posts and comments'), $font_size), + '$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), + )); + return $o; } - diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 8643925d3..26990823a 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -1,159 +1,70 @@ $nav_bg_1, +'$nav_bg_2' => $nav_bg_2, +'$nav_bg_3' => $nav_bg_3, +'$nav_bg_4' => $nav_bg_4, +'$background_colour' => $background_colour, +'$background_image' => $background_image, +'$item_colour' => $item_colour, +'$item_opacity' => $item_opacity, +'$font_size' => $font_size, +'$font_colour' => $font_colour, +'$radius' => $radius +); + +echo str_replace(array_keys($options), array_values($options), $x); - if(($redbasic_font_size >= 8.0) && ($redbasic_font_size <= 20.0)) { - echo ".wall-item-content { font-size: ${redbasic_font_size}px;}\r\n"; - } - - if(($line_height >= 1.0) && ($line_height <= 2.0)) { - echo ".wall-item-content { line-height: $line_height; }\r\n"; - } - - -// Minimum value shadows - they shouldn't all be the same size; just get it working, clean up later. - if($shadows === "true") { - echo "code, blockquote, .wall-item-content-wrapper, .wall-item-content-wrapper.comment, .wall-item-content img, #profile-jot-perms, #profile-jot-submit, .tab, .tab.active, .settings-widget li, .wall-item-photo, .photo, .contact-block-img, .my-comment-photo, #posted-date-selector:hover, .contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .group-selected, .nets-selected, .fileas-selected, .categories-selected { - box-shadow: 5px 5px 5px #111;}\r\n - - .tab.active, #jot-title, #jot-category, .comment-edit-text-empty, .comment-edit-text-full, iframe#profile-jot-text_ifr, #profile-jot-text { - box-shadow: 5px 5px 5px #666 inset;}\r\n"; - - } - -// Since every change would otherwise require five lines, it's simpler to just set a default and echo this without first checking if we've set it. - echo "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%) !important; - background-image: -webkit-linear-gradient(bottom, #$nav_bg_1 26%, #$nav_bg_2 82%); - background-image: -ms-linear-gradient(bottom, #$nav_bg_1 26%, #$nav_bg_2 82%);}"; - - if($navcolour === false || $navcolour === 'red') { - echo "nav:hover {background-image: linear-gradient(bottom, #$nav_bg_3 26%, #$nav_bg_4 82%); - background-image: -o-linear-gradient(bottom, #$nav_bg_3 26%, #$nav_bg_4 82%); - background-image: -moz-linear-gradient(bottom, #$nav_bg_3 26%, #$nav_bg_4 82%) !important; - background-image: -webkit-linear-gradient(bottom, #$nav_bg_3 26%, #$nav_bg_4 82%); - background-image: -ms-linear-gradient(bottom, #$nav_bg_3 26%, #$nav_bg_4 82%);}"; - } - -// This takes quite a lot of code, so we'll keep it in a separate file, and echo the lot. Devs still don't have to worry about - it's just overrides. -// Theme devs can play with it without facing scary PHP. - - if ($displaystyle === "fancy") - {if (file_exists('view/theme/' . current_theme() . '/css/fancy.css')) { - $fancy = (file_get_contents('view/theme/' . current_theme() . '/css/fancy.css')); - echo str_replace(array('$radius'),array($radius),$fancy); - } - } - -// Put the # here to force hex colours - if we don't, somebody is going to do something odd, using RGB and we're all going to be confused on the support forums -// until one of us works out what they've done. - - if ($linkcolour != false) { - echo "a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link {color: #$linkcolour;}\r\n"; - } - -// If you want a shiny that just sets a different colour, add an if $shiny != false and handle it as the linkcolour above. - - if ($shiny === 'opaque') { - echo "div.wall-item-content-wrapper.shiny {opacity: 1;}\r\n - .wall-item-content-wrapper {opacity: 0.8;}"; - } \ No newline at end of file +} diff --git a/view/theme/redbasic/tpl/basic_theme_settings.tpl b/view/theme/redbasic/tpl/basic_theme_settings.tpl deleted file mode 100755 index 33a34b292..000000000 --- a/view/theme/redbasic/tpl/basic_theme_settings.tpl +++ /dev/null @@ -1,14 +0,0 @@ -{{* - * AUTOMATICALLY GENERATED TEMPLATE - * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN - * - *}} -{{include file="field_select.tpl" field=$font_size}} - -{{include file="field_select.tpl" field=$line_height}} - -{{include file="field_select.tpl" field=$colour_scheme}} - -
- -
diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl old mode 100755 new mode 100644 index cd980fbc3..596670e95 --- a/view/theme/redbasic/tpl/theme_settings.tpl +++ b/view/theme/redbasic/tpl/theme_settings.tpl @@ -1,21 +1,10 @@ -{{include file="field_select.tpl" field=$colour}} - +{{include file="field_select.tpl" field=$nav_colour}} +{{include file="field_input.tpl" field=$background_colour}} +{{include file="field_input.tpl" field=$background_image}} +{{include file="field_input.tpl" field=$item_colour}} +{{include file="field_input.tpl" field=$item_opacity}} {{include file="field_input.tpl" field=$font_size}} - -{{include file="field_input.tpl" field=$line_height}} - -{{include file="field_select.tpl" field=$shadow}} - -{{include file="field_select.tpl" field=$navcolour}} - -{{include file="field_select.tpl" field=$displaystyle}} - -{{include file="field_input.tpl" field=$linkcolour}} - -{{include file="field_select.tpl" field=$iconset}} - -{{include file="field_select.tpl" field=$shiny}} - +{{include file="field_input.tpl" field=$font_colour}} {{include file="field_input.tpl" field=$radius}}
-- cgit v1.2.3