diff --git a/kernel/modules/module_shop_client/ModuleShopClientModule.php b/kernel/modules/module_shop_client/ModuleShopClientModule.php deleted file mode 100644 index 2bae379..0000000 --- a/kernel/modules/module_shop_client/ModuleShopClientModule.php +++ /dev/null @@ -1,32 +0,0 @@ -menuService = new MenuService(); - } - - /** - * @throws \Exception - */ - public function init(): void - { - $this->menuService->createItem([ - "label" => "Магазин модулей", - "url" => "/admin/module_shop_client", - "slug" => "module_shop_client", - ]); - } - - public function deactivate(): void - { - $this->menuService->removeItemBySlug("module_shop_client"); - } -} \ No newline at end of file diff --git a/kernel/modules/module_shop_client/manifest.json b/kernel/modules/module_shop_client/manifest.json index 2b84e36..cf19300 100644 --- a/kernel/modules/module_shop_client/manifest.json +++ b/kernel/modules/module_shop_client/manifest.json @@ -4,8 +4,6 @@ "author": "ITGuild", "slug": "module_shop_client", "description": "Module shop client module", - "module_class": "kernel\\modules\\module_shop_client\\ModuleShopClientModule", - "module_class_file": "{KERNEL_MODULES}/module_shop_client/ModuleShopClientModule.php", "routs": "routs/module_shop_client.php", "migration_path": "migrations", "dependence": "menu" diff --git a/kernel/modules/module_shop_client/views/index.php b/kernel/modules/module_shop_client/views/index.php index 37800fc..55a43a8 100644 --- a/kernel/modules/module_shop_client/views/index.php +++ b/kernel/modules/module_shop_client/views/index.php @@ -50,4 +50,6 @@ $table->addAction(function ($row, $url) use ($moduleService){ $table->create(); + +\kernel\widgets\ModuleTabsWidget::create()->run(); $table->render(); diff --git a/kernel/views/module/index.php b/kernel/views/module/index.php index 70c8696..3fcff21 100644 --- a/kernel/views/module/index.php +++ b/kernel/views/module/index.php @@ -54,16 +54,7 @@ $table->addAction(function ($row, $url) use ($moduleService) { $table->create(); - -?> - -
-isActive('module_shop_client')) { + \kernel\widgets\ModuleTabsWidget::create()->run(); +} $table->render(); diff --git a/kernel/views/module/view.php b/kernel/views/module/view.php index 7fb4409..168fcf9 100644 --- a/kernel/views/module/view.php +++ b/kernel/views/module/view.php @@ -23,7 +23,7 @@ $table_info = [ $table = new \Itguild\Tables\ViewJsonTable(json_encode($table_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); $table->beforePrint(function () { - $btn = PrimaryBtn::create("Список", "/admin/module")->fetch(); + $btn = PrimaryBtn::create("Список", "/admin")->fetch(); return $btn; }); $table->create(); diff --git a/kernel/widgets/ModuleTabsWidget.php b/kernel/widgets/ModuleTabsWidget.php new file mode 100644 index 0000000..94686f2 --- /dev/null +++ b/kernel/widgets/ModuleTabsWidget.php @@ -0,0 +1,18 @@ + 'Локальные', + '/admin/module_shop_client' => 'Каталог' + ]; + $this->cgView->render('/admin/module_tabs.php', ['tabs' => $tabs]); + } +} \ No newline at end of file diff --git a/views/widgets/admin/module_tabs.php b/views/widgets/admin/module_tabs.php new file mode 100644 index 0000000..ac618d2 --- /dev/null +++ b/views/widgets/admin/module_tabs.php @@ -0,0 +1,14 @@ + + + +
\ No newline at end of file