diff options
author | Mario <mario@mariovavti.com> | 2023-11-25 17:12:28 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-11-25 17:12:28 +0100 |
commit | 0fd8e02a884a2b040dca62ab5d9674db5f6a070b (patch) | |
tree | 586ee43f32f6f14368c09026f21dcd3244ea24b6 /Zotlabs/Module/Admin/Themes.php | |
parent | 82e704ec5b107823c09f1387e9091adee53a4c2d (diff) | |
parent | 55c4bfb67009c598f25b1a8189604bfffa73dfbb (diff) | |
download | volse-hubzilla-8.8.tar.gz volse-hubzilla-8.8.tar.bz2 volse-hubzilla-8.8.zip |
Merge branch '8.8RC'8.8
Diffstat (limited to 'Zotlabs/Module/Admin/Themes.php')
-rw-r--r-- | Zotlabs/Module/Admin/Themes.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Zotlabs/Module/Admin/Themes.php b/Zotlabs/Module/Admin/Themes.php index 8e72a1318..7f615afa8 100644 --- a/Zotlabs/Module/Admin/Themes.php +++ b/Zotlabs/Module/Admin/Themes.php @@ -80,10 +80,25 @@ class Themes { $this->toggle_theme($themes, $theme, $result); $s = $this->rebuild_theme_table($themes); - if($result) - info( sprintf('Theme %s enabled.', $theme)); - else - info( sprintf('Theme %s disabled.', $theme)); + + if($result) { + if (is_file("view/theme/$theme/php/config.php")){ + require_once("view/theme/$theme/php/config.php"); + if (function_exists($theme . '_theme_admin_enable')){ + call_user_func($theme . '_theme_admin_enable'); + } + } + info(sprintf('Theme %s enabled.', $theme)); + } + else { + if (is_file("view/theme/$theme/php/config.php")){ + require_once("view/theme/$theme/php/config.php"); + if (function_exists($theme . '_theme_admin_disable')){ + call_user_func($theme . '_theme_admin_disable'); + } + } + info(sprintf('Theme %s disabled.', $theme)); + } set_config('system', 'allowed_themes', $s); goaway(z_root() . '/admin/themes' ); |