getParsedBody()['params'] ?? $request->getQueryParams()['params']; if (($params['action'] ?? '') !== 'getContextHelp') { throw new \RuntimeException('Action must be set to "getContextHelp"', 1518787887); } $result = $this->getContextHelp($params['table'], $params['field']); return new JsonResponse([ 'title' => $result['title'], 'content' => $result['description'], 'link' => $result['moreInfo'] ]); } /** * Fetch the context help for the given table/field parameters * * @param string $table Table identifier * @param string $field Field identifier * @return array complete Help information */ protected function getContextHelp($table, $field) { $helpTextArray = BackendUtility::helpTextArray($table, $field); $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $moreIcon = $helpTextArray['moreInfo'] ? $iconFactory->getIcon('actions-view-go-forward', Icon::SIZE_SMALL)->render() : ''; return [ 'title' => $helpTextArray['title'], 'description' => '

' . $helpTextArray['description'] . $moreIcon . '

', 'id' => $table . '.' . $field, 'moreInfo' => $helpTextArray['moreInfo'] ]; } }