diff --git a/core/modules/comment/comment.routing.yml b/core/modules/comment/comment.routing.yml index 305d7b2..1151e55 100644 --- a/core/modules/comment/comment.routing.yml +++ b/core/modules/comment/comment.routing.yml @@ -2,7 +2,7 @@ comment.admin: path: '/admin/content/comment' defaults: _title: 'Comments' - _content: '\Drupal\comment\Controller\CommentController::adminPage' + _content: '\Drupal\comment\Controller\AdminController::adminPage' type: 'new' requirements: _permission: 'administer comments' @@ -11,7 +11,7 @@ comment.admin_approval: path: '/admin/content/comment/approval' defaults: _title: 'Unapproved comments' - _content: '\Drupal\comment\Controller\CommentController::adminPage' + _content: '\Drupal\comment\Controller\AdminController::adminPage' type: 'approval' requirements: _permission: 'administer comments' diff --git a/core/modules/comment/lib/Drupal/comment/Controller/AdminController.php b/core/modules/comment/lib/Drupal/comment/Controller/AdminController.php new file mode 100644 index 0000000..f5f9167 --- /dev/null +++ b/core/modules/comment/lib/Drupal/comment/Controller/AdminController.php @@ -0,0 +1,43 @@ +request->all(); + + if (isset($edit['operation']) && ($edit['operation'] == 'delete') && isset($edit['comments']) && $edit['comments']) { + return drupal_get_form(ConfirmDeleteMultiple::create($this->container()), $request); + } + else { + return drupal_get_form(CommentAdminOverview::create($this->container()), $type); + } + } + +} diff --git a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php index 37f7c41..e1b04bc 100644 --- a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php +++ b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php @@ -8,8 +8,6 @@ namespace Drupal\comment\Controller; use Drupal\comment\CommentInterface; -use Drupal\comment\Form\ConfirmDeleteMultiple; -use Drupal\comment\Form\CommentAdminOverview; use Drupal\node\NodeInterface; use Drupal\Core\Access\CsrfTokenGenerator; use Drupal\Core\Controller\ControllerBase; @@ -261,23 +259,4 @@ public function renderNewCommentsNodeLinks(Request $request) { return new JsonResponse($links); } - /** - * Presents an administrative comment listing. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The request of the page. - * @param string $type - * The type of the overview form ('approval' or 'new'). - */ - public function adminPage(Request $request, $type) { - $edit = $request->request->all(); - - if (isset($edit['operation']) && ($edit['operation'] == 'delete') && isset($edit['comments']) && $edit['comments']) { - return drupal_get_form(ConfirmDeleteMultiple::create($this->container()), $request); - } - else { - return drupal_get_form(CommentAdminOverview::create($this->container()), $type); - } - } - }