diff options
Diffstat (limited to 'view/theme/redbasic/php/theme.php')
-rw-r--r-- | view/theme/redbasic/php/theme.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php index fefd7d26c..5803198fd 100644 --- a/view/theme/redbasic/php/theme.php +++ b/view/theme/redbasic/php/theme.php @@ -9,10 +9,27 @@ * * Author: Fabrixxm * * Maintainer: Mike Macgirvin * * Maintainer: Mario Vavti - * * Theme_Color: #343a40 + * * Theme_Color: #212529 * * Background_Color: rgb(254,254,254) */ +use App; + function redbasic_init(&$a) { + $mode = ''; + + if (local_channel()) { + $mode = ((get_pconfig(local_channel(), 'redbasic', 'dark_mode')) ? 'dark' : 'light'); + } + + if (App::$profile_uid) { + $mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'dark_mode')) ? 'dark' : 'light'); + } + + if (!$mode) { + $mode = ((get_config('redbasic', 'dark_mode')) ? 'dark' : 'light'); + } + + App::$page['color_mode'] = 'data-bs-theme="' . $mode . '"'; } |