aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-19 16:41:12 -0700
committerfriendica <info@friendica.com>2013-10-19 16:41:12 -0700
commit3d8cce4a27638333c020c3ee0621231ce73d3eda (patch)
treed9c5a09ddbd13175f20824b2fe7940e9f2749a5b
parent4d92cc05c33d935d88526a430ba2cc0445959302 (diff)
parent2db45695e8067e49eb4c8a6d8044cd9cac7f07e5 (diff)
downloadvolse-hubzilla-3d8cce4a27638333c020c3ee0621231ce73d3eda.tar.gz
volse-hubzilla-3d8cce4a27638333c020c3ee0621231ce73d3eda.tar.bz2
volse-hubzilla-3d8cce4a27638333c020c3ee0621231ce73d3eda.zip
Merge pull request #183 from cvogeley/master
Redbasic: Allow people to set the width of the main section of the theme
-rw-r--r--view/theme/redbasic/css/style.css2
-rw-r--r--view/theme/redbasic/php/config.php7
-rw-r--r--view/theme/redbasic/php/style.php6
-rw-r--r--view/theme/redbasic/tpl/theme_settings.tpl2
4 files changed, 13 insertions, 4 deletions
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index d6c1b3511..9bdd4e1e5 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -125,6 +125,8 @@ nav {background-image: 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%);
}
+section {width: $section_width;
+}
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%);
diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php
index 90bd109ad..053940219 100644
--- a/view/theme/redbasic/php/config.php
+++ b/view/theme/redbasic/php/config.php
@@ -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,11 +32,12 @@ 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");
@@ -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 3344fcb3a..c4bd2e15a 100644
--- a/view/theme/redbasic/php/style.php
+++ b/view/theme/redbasic/php/style.php
@@ -21,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
@@ -69,6 +70,8 @@
$shadow = "0";
if(! $active_colour)
$active_colour = '#FFFFFF';
+ if (! $section_width)
+ $section_width="72%";
@@ -113,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);
diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl
index 45dd529fa..4e4b6002c 100644
--- a/view/theme/redbasic/tpl/theme_settings.tpl
+++ b/view/theme/redbasic/tpl/theme_settings.tpl
@@ -13,7 +13,7 @@
{{include file="field_input.tpl" field=$font_colour}}
{{include file="field_input.tpl" field=$radius}}
{{include file="field_input.tpl" field=$shadow}}
-
+{{include file="field_input.tpl" field=$section_width}}
<div class="settings-submit-wrapper">
<input type="submit" value="{{$submit}}" class="settings-submit" name="redbasic-settings-submit" />
</div>