getQueryParams(); $table = $params['table'] ?? ''; $identifier = $params['uid'] ?? ''; $context = $params['context'] ?? ''; if ($table === '' || $identifier === '') { return new JsonResponse([], 400); } $items = $contextMenu->getItems($table, $identifier, $context); return new JsonResponse($items); } public function clipboardAction(ServerRequestInterface $request): ResponseInterface { $clipboard = GeneralUtility::makeInstance(Clipboard::class); $clipboard->initializeClipboard($request); $clipboard->lockToNormal(); $queryParams = $request->getQueryParams(); $parsedBody = $request->getParsedBody(); $clipboardCommand = array_replace_recursive($queryParams['CB'] ?? [], $parsedBody['CB'] ?? []); // URL-decoded keys are required for the clipboard to recognize file identifiers (e.g. _FILE|...) if (isset($clipboardCommand['el']) && is_array($clipboardCommand['el'])) { $decodedElements = []; foreach ($clipboardCommand['el'] as $key => $value) { $decodedElements[urldecode((string)$key)] = $value; } $clipboardCommand['el'] = $decodedElements; } $clipboard->setCmd($clipboardCommand); $clipboard->cleanCurrent(); $clipboard->endClipboard(); return new JsonResponse([]); } }