aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/redbasic/php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-01-26 18:28:40 +0000
committerMario <mario@mariovavti.com>2023-01-26 18:28:40 +0000
commit79b40179b40b0f1539e58a8c2c7d7f914e6b212b (patch)
tree4e4ae56930f3d3599aad1fdcfe6653d8c5e5be32 /view/theme/redbasic/php
parent60c968222f0090757dfc20a00433e926c6180fce (diff)
downloadvolse-hubzilla-79b40179b40b0f1539e58a8c2c7d7f914e6b212b.tar.gz
volse-hubzilla-79b40179b40b0f1539e58a8c2c7d7f914e6b212b.tar.bz2
volse-hubzilla-79b40179b40b0f1539e58a8c2c7d7f914e6b212b.zip
redbasic: implement setting for always light navbar icons and some minor fixes
Diffstat (limited to 'view/theme/redbasic/php')
-rw-r--r--view/theme/redbasic/php/config.php3
-rw-r--r--view/theme/redbasic/php/theme.php5
2 files changed, 8 insertions, 0 deletions
diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php
index 87a4c45d5..ef1cb7a11 100644
--- a/view/theme/redbasic/php/config.php
+++ b/view/theme/redbasic/php/config.php
@@ -38,6 +38,7 @@ class RedbasicConfig {
$arr = array();
$arr['dark_mode'] = get_pconfig(local_channel(),'redbasic', 'dark_mode');
+ $arr['navbar_dark_mode'] = get_pconfig(local_channel(),'redbasic', 'navbar_dark_mode');
$arr['narrow_navbar'] = get_pconfig(local_channel(),'redbasic', 'narrow_navbar' );
$arr['nav_bg'] = get_pconfig(local_channel(),'redbasic', 'nav_bg' );
$arr['nav_bg_dark'] = get_pconfig(local_channel(),'redbasic', 'nav_bg_dark' );
@@ -65,6 +66,7 @@ class RedbasicConfig {
if (isset($_POST['redbasic-settings-submit'])) {
set_pconfig(local_channel(), 'redbasic', 'narrow_navbar', $_POST['redbasic_narrow_navbar']);
+ set_pconfig(local_channel(), 'redbasic', 'navbar_dark_mode', $_POST['redbasic_navbar_dark_mode']);
set_pconfig(local_channel(), 'redbasic', 'dark_mode', $_POST['redbasic_dark_mode']);
set_pconfig(local_channel(), 'redbasic', 'nav_bg', $_POST['redbasic_nav_bg']);
set_pconfig(local_channel(), 'redbasic', 'nav_bg_dark', $_POST['redbasic_nav_bg_dark']);
@@ -99,6 +101,7 @@ class RedbasicConfig {
'$expert' => $expert,
'$title' => t("Theme settings"),
'$dark_mode' => array('redbasic_dark_mode',t('Default to dark mode'),$arr['dark_mode'], '', array(t('No'),t('Yes'))),
+ '$navbar_dark_mode' => array('redbasic_navbar_dark_mode',t('Always use light icons for navbar'),$arr['navbar_dark_mode'], t('Enable this option if you use a dark navbar color in light mode'), array(t('No'),t('Yes'))),
'$narrow_navbar' => array('redbasic_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar'], '', array(t('No'),t('Yes'))),
'$nav_bg' => array('redbasic_nav_bg', t('Navigation bar background color'), $arr['nav_bg']),
'$nav_bg_dark' => array('redbasic_nav_bg_dark', t('Dark navigation bar background color'), $arr['nav_bg_dark']),
diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php
index abfac05b6..8864f5ea5 100644
--- a/view/theme/redbasic/php/theme.php
+++ b/view/theme/redbasic/php/theme.php
@@ -18,18 +18,23 @@ use App;
function redbasic_init(&$a) {
$mode = '';
+ $navbar_mode = '';
if (local_channel()) {
$mode = ((get_pconfig(local_channel(), 'redbasic', 'dark_mode')) ? 'dark' : 'light');
+ $navbar_mode = ((get_pconfig(local_channel(), 'redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
}
if (App::$profile_uid) {
$mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'dark_mode')) ? 'dark' : 'light');
+ $navbar_mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
}
if (!$mode) {
$mode = ((get_config('redbasic', 'dark_mode')) ? 'dark' : 'light');
+ $navbar_mode = ((get_config('redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
}
App::$page['color_mode'] = 'data-bs-theme="' . $mode . '"';
+ App::$page['navbar_color_mode'] = (($navbar_mode === 'dark') ? 'data-bs-theme="' . $navbar_mode . '"' : '');
}