theme uninstall add

This commit is contained in:
2024-09-12 12:06:44 +03:00
parent 42b28df07d
commit d7851a4160
214 changed files with 17 additions and 32421 deletions

View File

@ -42,8 +42,24 @@ class AdminThemeController extends ConsoleController
$this->out->r("Тема " . $manifest['name'] . " установлена", 'green');
}
}
public function actionUninstallTheme(): void
{
if (!isset($this->argv['path'])) {
throw new \Exception('Missing admin theme path "--path" specified');
}
if (file_exists(ROOT_DIR . $this->argv['path'])) {
$themeName = basename($this->argv['path']);
$fileHelper = new Files();
$fileHelper->recursiveRemoveDir(ROOT_DIR . $this->argv['path']);
$fileHelper->recursiveRemoveDir(RESOURCES_DIR . '/' . $themeName);
$this->out->r("Тема удалена", 'green');
} else {
$this->out->r("Тема не найдена", 'red');
}
}
}

View File

@ -14,5 +14,6 @@ App::$collector->group(["prefix" => "migration"], callback: function (RouteColle
App::$collector->group(["prefix" => "admin-theme"], callback: function (RouteCollector $router){
App::$collector->console('install', [\kernel\console\controllers\AdminThemeController::class, 'actionInstallTheme']);
App::$collector->console('uninstall', [\kernel\console\controllers\AdminThemeController::class, 'actionUninstallTheme']);
});

View File

@ -27,13 +27,6 @@ $form->field(class: \itguild\forms\inputs\File::class, name: "icon_file", params
->setLabel("Путь к иконке")
->render();
$form->field(\itguild\forms\inputs\Checkbox::class, "hashing", params:[
'value' => false
// 'class' => "form-control"
])
->setLabel('Не хешировать')
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "icon_font", params: [
'class' => "form-control",
'value' => $model->icon_font ?? ''