wikiService = $wikiService; } /** * Displays the delete wiki confirmation. * * @param array $params Request parameters */ #[RequiresPermission(WikiPermissions::DELETE)] public function get(array $params): Response { return $this->tpl->displayPartial('wiki.delWiki'); } /** * Handles wiki deletion. The controller gate defers (entityScoped) to the service's * deleteWiki(), which authorizes DELETE against the wiki's REAL project. * * @param array $params Request parameters */ #[RequiresPermission(WikiPermissions::DELETE, entityScoped: true)] public function post(array $params): Response { $id = (int) ($params['id'] ?? $_GET['id'] ?? 0); if (isset($_POST['del']) && $id > 0) { $this->wikiService->deleteWiki($id); $this->tpl->setNotification($this->language->__('notification.wiki_deleted'), 'success', 'wiki_deleted'); return Frontcontroller::redirect(BASE_URL.'/wiki/show'); } return $this->tpl->displayPartial('wiki.delWiki'); } }