From 7758dd29251a92bf02d8b03f2bd4051cf2079f77 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Thu, 12 Sep 2024 12:56:10 +0300 Subject: [PATCH] theme uninstall fix --- kernel/console/controllers/AdminThemeController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/console/controllers/AdminThemeController.php b/kernel/console/controllers/AdminThemeController.php index 63655e3..585bc30 100644 --- a/kernel/console/controllers/AdminThemeController.php +++ b/kernel/console/controllers/AdminThemeController.php @@ -5,6 +5,8 @@ namespace kernel\console\controllers; use kernel\console\ConsoleController; use kernel\helpers\Files; use kernel\helpers\Manifest; +use kernel\models\Option; +use kernel\services\AdminThemeService; use ZipArchive; class AdminThemeController extends ConsoleController @@ -52,6 +54,15 @@ class AdminThemeController extends ConsoleController if (file_exists(ROOT_DIR . $this->argv['path'])) { $themeName = basename($this->argv['path']); + $active_admin_theme = Option::where("key", "active_admin_theme")->first(); + var_dump($active_admin_theme->value); + var_dump(ROOT_DIR . $this->argv['path']); + if ($active_admin_theme->value === ROOT_DIR . $this->argv['path']) { + $this->out->r("Меняем тему на базовую", 'green'); + $adminThemeService = new AdminThemeService(); + $adminThemeService->setActiveAdminTheme(KERNEL_ADMIN_THEMES_DIR . '/default'); + $this->out->r("Тема изменена", 'green'); + } $fileHelper = new Files(); $fileHelper->recursiveRemoveDir(ROOT_DIR . $this->argv['path']); $fileHelper->recursiveRemoveDir(RESOURCES_DIR . '/' . $themeName);