diff options
author | Mario <mario@mariovavti.com> | 2023-03-19 13:55:18 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-03-19 13:55:18 +0000 |
commit | 89285f1408d21091bb80d45b391ddcbe06ba8d0f (patch) | |
tree | b2eb07d9f3d91d77f89a4565a58e6e5231b20c1c /view/theme/redbasic/php/theme.php | |
parent | 0a679e503ef367eda3085c44af103ee53869a94f (diff) | |
parent | 17c0bb2069dcfe35d3febc5bfdb3a7295f15d49c (diff) | |
download | volse-hubzilla-89285f1408d21091bb80d45b391ddcbe06ba8d0f.tar.gz volse-hubzilla-89285f1408d21091bb80d45b391ddcbe06ba8d0f.tar.bz2 volse-hubzilla-89285f1408d21091bb80d45b391ddcbe06ba8d0f.zip |
Merge branch '8.2RC'8.2
Diffstat (limited to 'view/theme/redbasic/php/theme.php')
-rw-r--r-- | view/theme/redbasic/php/theme.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php index fefd7d26c..b7e08705c 100644 --- a/view/theme/redbasic/php/theme.php +++ b/view/theme/redbasic/php/theme.php @@ -9,10 +9,31 @@ * * Author: Fabrixxm * * Maintainer: Mike Macgirvin * * Maintainer: Mario Vavti - * * Theme_Color: #343a40 + * * Theme_Color: rgb(248, 249, 250) * * Background_Color: rgb(254,254,254) */ + 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 . '"' : ''); } |