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);