Skip to content

Commit

Permalink
[TASK] PageLayoutModule: Add unlink to ajax functionality
Browse files Browse the repository at this point in the history
Related: #400
Release: 8.0.0
  • Loading branch information
opi99 committed Jun 22, 2022
1 parent 2a53fca commit 823e88b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Classes/Controller/Backend/Ajax/ContentElements.php
Expand Up @@ -149,4 +149,22 @@ public function remove(ServerRequestInterface $request): ResponseInterface

return new JsonResponse([$result]);
}

/**
* @param ServerRequestInterface $request the current request
* @return ResponseInterface the response with the content
*/
public function unlink(ServerRequestInterface $request): ResponseInterface
{
/** @var ProcessingService */
$processingService = GeneralUtility::makeInstance(ProcessingService::class);

$parameters = $request->getParsedBody();

$result = $processingService->unlinkElement(
$parameters['sourcePointer'] ?? ''
);

return new JsonResponse([$result]);
}
}
5 changes: 5 additions & 0 deletions Configuration/Backend/AjaxRoutes.php
Expand Up @@ -32,6 +32,11 @@
'access' => 'user,group',
'target' => \Tvp\TemplaVoilaPlus\Controller\Backend\Ajax\ContentElements::class . '::move',
],
'templavoilaplus_contentElement_unlink' => [
'path' => '/templavoilaplus/contentElement/unlink',
'access' => 'user,group',
'target' => \Tvp\TemplaVoilaPlus\Controller\Backend\Ajax\ContentElements::class . '::unlink',
],
'templavoilaplus_contentElement_remove' => [
'path' => '/templavoilaplus/contentElement/remove',
'access' => 'user,group',
Expand Down

0 comments on commit 823e88b

Please sign in to comment.