admin theme
This commit is contained in:
29
kernel/console/controllers/AdminTheme.php
Normal file
29
kernel/console/controllers/AdminTheme.php
Normal 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!';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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']);
|
||||
});
|
||||
|
||||
|
@ -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 ?? ''
|
||||
|
Reference in New Issue
Block a user