aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/redbasic/php
diff options
context:
space:
mode:
Diffstat (limited to 'view/theme/redbasic/php')
-rw-r--r--view/theme/redbasic/php/config.php8
-rw-r--r--view/theme/redbasic/php/theme.php22
-rw-r--r--view/theme/redbasic/php/theme_init.php25
3 files changed, 31 insertions, 24 deletions
diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php
index b4cb281b9..344f3ff68 100644
--- a/view/theme/redbasic/php/config.php
+++ b/view/theme/redbasic/php/config.php
@@ -129,7 +129,15 @@ class RedbasicConfig {
}
+function redbasic_theme_admin_enable() {
+ // This function is called once when the theme is being enabled by the admin
+ // It can be used to register hooks etc.
+}
+function redbasic_theme_admin_disable() {
+ // This function is called once when the theme is being disabled by the admin
+ // It can be used to unregister hooks etc.
+}
diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php
index b7e08705c..c33c4f78e 100644
--- a/view/theme/redbasic/php/theme.php
+++ b/view/theme/redbasic/php/theme.php
@@ -14,26 +14,6 @@
*/
-function redbasic_init(&$a) {
+function redbasic_init() {
- $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 . '"' : '');
}
diff --git a/view/theme/redbasic/php/theme_init.php b/view/theme/redbasic/php/theme_init.php
index 0ac580f0e..cb81165b1 100644
--- a/view/theme/redbasic/php/theme_init.php
+++ b/view/theme/redbasic/php/theme_init.php
@@ -1,15 +1,34 @@
<?php
+require_once('view/php/theme_init.php');
head_add_css('/library/fork-awesome/css/fork-awesome.min.css');
head_add_css('/vendor/twbs/bootstrap/dist/css/bootstrap.min.css');
head_add_css('/library/bootstrap-tagsinput/bootstrap-tagsinput.css');
head_add_css('/view/css/bootstrap-red.css');
-head_add_css('/library/datetimepicker/jquery.datetimepicker.css');
head_add_css('/library/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css');
-require_once('view/php/theme_init.php');
head_add_js('/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js');
head_add_js('/library/bootbox/bootbox.min.js');
head_add_js('/library/bootstrap-tagsinput/bootstrap-tagsinput.js');
-head_add_js('/library/datetimepicker/jquery.datetimepicker.js');
head_add_js('/library/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js');
+
+$redbasic_mode = '';
+$redbasic_navbar_mode = '';
+
+if (local_channel()) {
+ $redbasic_mode = ((get_pconfig(local_channel(), 'redbasic', 'dark_mode')) ? 'dark' : 'light');
+ $redbasic_navbar_mode = ((get_pconfig(local_channel(), 'redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
+}
+
+if (App::$profile_uid) {
+ $redbasic_mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'dark_mode')) ? 'dark' : 'light');
+ $redbasic_navbar_mode = ((get_pconfig(App::$profile_uid, 'redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
+}
+
+if (!$redbasic_mode) {
+ $redbasic_mode = ((get_config('redbasic', 'dark_mode')) ? 'dark' : 'light');
+ $redbasic_navbar_mode = ((get_config('redbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
+}
+
+App::$page['color_mode'] = 'data-bs-theme="' . $redbasic_mode . '"';
+App::$page['navbar_color_mode'] = (($redbasic_navbar_mode === 'dark') ? 'data-bs-theme="' . $redbasic_navbar_mode . '"' : '');