admin theme

This commit is contained in:
2024-09-10 16:44:27 +03:00
parent 89b6f1ac8c
commit 69b27d4975
111 changed files with 16247 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace kernel\console\controllers;
use app\helpers\Debug;
use kernel\console\ConsoleController;
use ZipArchive;
class AdminTheme extends ConsoleController
{
public function actionInstallTheme()
{
if (!isset($this->argv['path'])) {
throw new \Exception('Missing admin theme path "--path" specified');
}
$zip = new ZipArchive;
$res = $zip->open(ROOT_DIR . $this->argv['path']);
if ($res === TRUE) {
$zip->extractTo(RESOURCES_DIR . '/tmp/ad/');
$zip->close();
echo 'woot!';
} else {
echo 'doh!';
}
}
}

View File

@ -12,3 +12,7 @@ App::$collector->group(["prefix" => "migration"], callback: function (RouteColle
App::$collector->console('rollback', [\kernel\console\controllers\MigrationController::class, 'actionRollback']);
});
App::$collector->group(["prefix" => "admin-theme"], callback: function (RouteCollector $router){
App::$collector->console('install', [\kernel\console\controllers\AdminTheme::class, 'actionInstallTheme']);
});

View File

@ -16,6 +16,10 @@ $form->field(class: \itguild\forms\inputs\Select::class, name: "parent_id", para
->setOptions(\kernel\modules\menu\service\MenuService::createLabelArr())
->render();
if (!empty($model->icon_file)){
echo "<div><img src='$model->icon_file' width='200px'></div>";
}
$form->field(class: \itguild\forms\inputs\File::class, name: "icon_file", params: [
'class' => "form-control",
'value' => $model->icon_file ?? ''