backend/kernel/modules/admin_themes/AdminThemesModule.php

34 lines
730 B
PHP
Raw Normal View History

2024-09-12 16:01:04 +03:00
<?php
namespace kernel\modules\admin_themes;
use kernel\Module;
2024-09-23 17:03:42 +03:00
use kernel\modules\menu\service\MenuService;
2024-09-12 16:01:04 +03:00
class AdminThemesModule extends Module
{
2024-09-23 17:03:42 +03:00
public MenuService $menuService;
public function __construct()
2024-09-12 16:01:04 +03:00
{
2024-09-23 17:03:42 +03:00
$this->menuService = new MenuService();
}
/**
* @throws \Exception
*/
public function init(): void
{
$this->menuService->createItem([
"label" => "Темы админпанели",
"url" => "/admin/settings/admin-themes",
"slug" => "admin-themes",
"parent_slug" => "settings"
]);
}
public function deactivate(): void
{
$this->menuService->removeItemBySlug("admin-themes");
2024-09-12 16:01:04 +03:00
}
}