<?php

namespace kernel\modules\themes;

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

class ThemesModule 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/themes",
            "slug" => "themes",
            "parent_slug" => "settings"
        ]);
    }

    public function deactivate(): void
    {
        $this->menuService->removeItemBySlug("themes");
    }
}