<?php

namespace kernel\modules\admin_themes;

use kernel\Module;
use kernel\modules\menu\service\MenuService;

class AdminThemesModule extends Module
{

    public MenuService $menuService;
    public function __construct()
    {
        $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");
    }
}