aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/redbasic/php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-02-25 16:33:40 +0100
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-02-25 16:33:40 +0100
commit0a98f6b878ec89be7282621192d9daf80f125e6c (patch)
tree718a4771ce1fb86931531226898b0b5d00e4a337 /view/theme/redbasic/php
parent34d30e4d7eb48bd801482531a0d775328bd43ab4 (diff)
parentb1021df485fb6129acda5bba616bac10aea75a45 (diff)
downloadvolse-hubzilla-0a98f6b878ec89be7282621192d9daf80f125e6c.tar.gz
volse-hubzilla-0a98f6b878ec89be7282621192d9daf80f125e6c.tar.bz2
volse-hubzilla-0a98f6b878ec89be7282621192d9daf80f125e6c.zip
Merge pull request #1 from friendica/master
Update this fork
Diffstat (limited to 'view/theme/redbasic/php')
-rw-r--r--view/theme/redbasic/php/config.php20
-rw-r--r--view/theme/redbasic/php/style.php46
2 files changed, 62 insertions, 4 deletions
diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php
index 20355197f..2235a9742 100644
--- a/view/theme/redbasic/php/config.php
+++ b/view/theme/redbasic/php/config.php
@@ -6,7 +6,9 @@ function theme_content(&$a) {
$arr = array();
$arr['schema'] = get_pconfig(local_user(),'redbasic', 'schema' );
+ $arr['narrow_navbar'] = get_pconfig(local_user(),'redbasic', 'narrow_navbar' );
$arr['nav_colour'] = get_pconfig(local_user(),'redbasic', 'nav_colour' );
+ $arr['link_colour'] = get_pconfig(local_user(),'redbasic', 'link_colour' );
$arr['banner_colour'] = get_pconfig(local_user(),'redbasic', 'banner_colour' );
$arr['bgcolour'] = get_pconfig(local_user(),'redbasic', 'background_colour' );
$arr['background_image'] = get_pconfig(local_user(),'redbasic', 'background_image' );
@@ -32,7 +34,9 @@ function theme_post(&$a) {
if (isset($_POST['redbasic-settings-submit'])) {
set_pconfig(local_user(), 'redbasic', 'schema', $_POST['redbasic_schema']);
+ set_pconfig(local_user(), 'redbasic', 'narrow_navbar', $_POST['redbasic_narrow_navbar']);
set_pconfig(local_user(), 'redbasic', 'nav_colour', $_POST['redbasic_nav_colour']);
+ set_pconfig(local_user(), 'redbasic', 'link_colour', $_POST['redbasic_link_colour']);
set_pconfig(local_user(), 'redbasic', 'background_colour', $_POST['redbasic_background_colour']);
set_pconfig(local_user(), 'redbasic', 'banner_colour', $_POST['redbasic_banner_colour']);
set_pconfig(local_user(), 'redbasic', 'background_image', $_POST['redbasic_background_image']);
@@ -72,9 +76,17 @@ function redbasic_form(&$a, $arr) {
$nav_colours = array (
'' => t('Scheme Default'),
- 'red' => t('red'),
- 'black' => t('black'),
- 'silver' => t('silver'),
+ 'red' => 'red',
+ 'pink' => 'pink',
+ 'green' => 'green',
+ 'blue' => 'blue',
+ 'purple' => 'purple',
+ 'black' => 'black',
+ 'orange' => 'orange',
+ 'brown' => 'brown',
+ 'grey' => 'grey',
+ 'gold' => 'gold',
+ 'silver' => t('silver'),
);
if(feature_enabled(local_user(),'expert'))
@@ -87,7 +99,9 @@ if(feature_enabled(local_user(),'expert'))
'$expert' => $expert,
'$title' => t("Theme settings"),
'$schema' => array('redbasic_schema', t('Set scheme'), $arr['schema'], '', $scheme_choices),
+ '$narrow_navbar' => array('redbasic_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar']),
'$nav_colour' => array('redbasic_nav_colour', t('Navigation bar colour'), $arr['nav_colour'], '', $nav_colours),
+ '$link_colour' => array('redbasic_link_colour', t('link colour'), $arr['link_colour'], '', $link_colours),
'$banner_colour' => array('redbasic_banner_colour', t('Set font-colour for banner'), $arr['banner_colour']),
'$bgcolour' => array('redbasic_background_colour', t('Set the background colour'), $arr['bgcolour']),
'$background_image' => array('redbasic_background_image', t('Set the background image'), $arr['background_image']),
diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php
index 9956ccd31..901d06af7 100644
--- a/view/theme/redbasic/php/style.php
+++ b/view/theme/redbasic/php/style.php
@@ -1,5 +1,7 @@
<?php
-// Get the UID of the channel owner
+
+if(! $a->install) {
+ // Get the UID of the channel owner
$uid = get_theme_uid();
if($uid)
@@ -12,7 +14,9 @@
$nav_colour = get_pconfig($uid, "redbasic", "nav_colour");
// Load the owners pconfig
+ $narrow_navbar = get_pconfig($uid,'redbasic','narrow_navbar');
$banner_colour = get_pconfig($uid,'redbasic','banner_colour');
+ $link_colour = get_pconfig($uid, "redbasic", "link_colour");
$schema = get_pconfig($uid,'redbasic','schema');
$bgcolour = get_pconfig($uid, "redbasic", "background_colour");
$background_image = get_pconfig($uid, "redbasic", "background_image");
@@ -31,6 +35,8 @@
$top_photo=get_pconfig($uid,'redbasic','top_photo');
$reply_photo=get_pconfig($uid,'redbasic','reply_photo');
+}
+
// 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
@@ -63,6 +69,8 @@
$nav_bg_3 = "#f00";
$nav_bg_4 = "#b00";
}
+ if (! $link_colour)
+ $link_colour = "#0080FF";
if (! $banner_colour)
$banner_colour = "fff";
if (! $bgcolour)
@@ -130,6 +138,38 @@
$nav_bg_1 = $nav_bg_2 = $nav_bg_3 = $nav_bg_4 = "silver";
$search_background = '#EEEEEE';
}
+ if($nav_colour === "pink") {
+ $nav_bg_1 = $nav_bg_3 = "#FFC1CA";
+ $nav_bg_2 = $nav_bg_4 = "#FFC1CA";
+ }
+ if($nav_colour === "green") {
+ $nav_bg_1 = $nav_bg_3 = "#5CD65C";
+ $nav_bg_2 = $nav_bg_4 = "#5CD65C";
+ }
+ if($nav_colour === "blue") {
+ $nav_bg_1 = $nav_bg_3 = "#1872a2";
+ $nav_bg_2 = $nav_bg_4 = "#1872a2";
+ }
+ if($nav_colour === "purple") {
+ $nav_bg_1 = $nav_bg_3 = "#551A8B";
+ $nav_bg_2 = $nav_bg_4 = "#551A8B";
+ }
+ if($nav_colour === "orange") {
+ $nav_bg_1 = $nav_bg_3 = "#FF3D0D";
+ $nav_bg_2 = $nav_bg_4 = "#FF3D0D";
+ }
+ if($nav_colour === "brown") {
+ $nav_bg_1 = $nav_bg_3 = "#330000";
+ $nav_bg_2 = $nav_bg_4 = "#330000";
+ }
+ if($nav_colour === "grey") {
+ $nav_bg_1 = $nav_bg_3 = "#2e2f2e";
+ $nav_bg_2 = $nav_bg_4 = "#2e2f2e";
+ }
+ if($nav_colour === "gold") {
+ $nav_bg_1 = $nav_bg_3 = "#FFAA00";
+ $nav_bg_2 = $nav_bg_4 = "#FFAA00";
+ }
// Apply the settings
@@ -141,6 +181,7 @@ $options = array (
'$nav_bg_2' => $nav_bg_2,
'$nav_bg_3' => $nav_bg_3,
'$nav_bg_4' => $nav_bg_4,
+'$link_colour' => $link_colour,
'$banner_colour' => $banner_colour,
'$search_background' => $search_background,
'$bgcolour' => $bgcolour,
@@ -173,3 +214,6 @@ echo str_replace(array_keys($options), array_values($options), $x);
if($sloppy_photos && file_exists('view/theme/redbasic/css/sloppy_photos.css')) {
echo file_get_contents('view/theme/redbasic/css/sloppy_photos.css');
}
+if($narrow_navbar && file_exists('view/theme/redbasic/css/narrow_navbar.css')) {
+ echo file_get_contents('view/theme/redbasic/css/narrow_navbar.css');
+}