data['renderData']['fieldControlOptions']; $title = $options['title'] ?? 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.link'; $parameterArray = $this->data['parameterArray']; $itemName = $parameterArray['itemFormElName']; $linkBrowserArguments = []; if (is_array($options['allowedTypes'] ?? false)) { $linkBrowserArguments['allowedTypes'] = implode(',', $options['allowedTypes']); } elseif (isset($options['blindLinkOptions'])) { // @todo Deprecate this option $linkBrowserArguments['blindLinkOptions'] = $options['blindLinkOptions']; } if (is_array($options['allowedOptions'] ?? false)) { $linkBrowserArguments['allowedOptions'] = implode(',', $options['allowedOptions']); } elseif (isset($options['blindLinkFields'])) { // @todo Deprecate this option $linkBrowserArguments['blindLinkFields'] = $options['blindLinkFields']; } if (is_array($options['allowedFileExtensions'] ?? false)) { $linkBrowserArguments['allowedFileExtensions'] = implode(',', $options['allowedFileExtensions']); } elseif (isset($options['allowedExtensions'])) { // @todo Deprecate this option $linkBrowserArguments['allowedExtensions'] = $options['allowedExtensions']; } $urlParameters = array_merge( [ 'params' => $linkBrowserArguments, 'table' => $this->data['tableName'], 'uid' => $this->data['databaseRow']['uid'], 'pid' => $this->data['databaseRow']['pid'], 'field' => $this->data['fieldName'], 'formName' => 'editform', 'itemName' => $itemName, 'hmac' => $this->hashService->hmac('editform' . $itemName, 'wizard_js'), ], $this->forwardOnFieldChangeQueryParams($parameterArray['fieldChangeFunc'] ?? []) ); $url = (string)$this->uriBuilder->buildUriFromRoute('wizard_link', ['P' => $urlParameters]); $id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-'); $label = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_browse_links.xlf:openLinkWizard'); return [ 'iconIdentifier' => 'actions-wizard-link', 'title' => $title, 'linkAttributes' => [ 'id' => $id, 'href' => $url, 'data-item-name' => $itemName, 'aria-label' => $label, ], 'javaScriptModules' => [ JavaScriptModuleInstruction::create('@typo3/backend/form-engine/field-control/link-popup.js')->instance('#' . $id), ], ]; } protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } }