diff --git a/app/modules/tag/TagModule.php b/app/modules/tag/TagModule.php new file mode 100644 index 0000000..b2f0ffd --- /dev/null +++ b/app/modules/tag/TagModule.php @@ -0,0 +1,38 @@ +menuService = new MenuService(); + $this->migrationService = new MigrationService(); + } + + /** + * @throws \Exception + */ + public function init(): void + { + $this->migrationService->runAtPath("{KERNEL_APP_MODULES}/tag/migrations"); + + $this->menuService->createItem([ + "label" => "Тэги", + "url" => "/admin/tag", + "slug" => "tag", + ]); + } + + public function deactivate(): void + { + $this->menuService->removeItemBySlug("tag"); + } +} \ No newline at end of file diff --git a/app/modules/tag/controllers/TagController.php b/app/modules/tag/controllers/TagController.php new file mode 100644 index 0000000..e0212a2 --- /dev/null +++ b/app/modules/tag/controllers/TagController.php @@ -0,0 +1,13 @@ +isEmpty()){ foreach ($child as $item){ -// if ($item->url === \kernel\Request::getUrlPath()){ -// return true; -// } if (strripos(Request::getUrlPath(), $item->url) !== false) { return true; } diff --git a/kernel/views/module/index.php b/kernel/views/module/index.php index 3fcff21..8bf0051 100644 --- a/kernel/views/module/index.php +++ b/kernel/views/module/index.php @@ -47,10 +47,10 @@ $table->addAction(function ($row, $url) use ($moduleService) { return "Просмотр"; }); -$table->addAction(function ($row, $url) use ($moduleService) { - $slug = $row['slug']; - return "Обновить"; -}); +//$table->addAction(function ($row, $url) use ($moduleService) { +// $slug = $row['slug']; +// return "Обновить"; +//}); $table->create(); diff --git a/views/widgets/admin/menu.php b/views/widgets/admin/menu.php index fe5773b..124c239 100644 --- a/views/widgets/admin/menu.php +++ b/views/widgets/admin/menu.php @@ -18,7 +18,7 @@ -
  • "> +
  • "> label ?>