diff --git a/typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php b/typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php index f1442d9779fc097609a9dafb215cdc39a208dfa4..5594610f35382deff62677ca8674478d98b99a13 100644 --- a/typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php @@ -210,7 +210,7 @@ class InputLinkElement extends AbstractFormElement $expansionHtml[] = '<div class="form-wizards-element">'; $expansionHtml[] = '<div class="input-group t3js-form-field-inputlink">'; $expansionHtml[] = '<span class="input-group-addon">' . $linkExplanation['icon'] . '</span>'; - $expansionHtml[] = '<div class="form-control form-field-inputlink-explanation t3js-form-field-inputlink-explanation" data-toggle="tooltip" data-title="' . $explanation . '">' . $explanation . '</div>'; + $expansionHtml[] = '<input class="form-control form-field-inputlink-explanation t3js-form-field-inputlink-explanation" data-toggle="tooltip" data-title="' . $explanation . '" value="' . $explanation . '" readonly>'; $expansionHtml[] = '<input type="text"' . GeneralUtility::implodeAttributes($attributes, true) . ' />'; $expansionHtml[] = '<span class="input-group-btn">'; $expansionHtml[] = '<button class="btn btn-default t3js-form-field-inputlink-explanation-toggle" type="button" title="' . htmlspecialchars($toggleButtonTitle) . '">'; @@ -339,7 +339,7 @@ class InputLinkElement extends AbstractFormElement break; case LinkService::TYPE_URL: $data = [ - 'text' => $linkData['url'], + 'text' => $this->getDomainByUrl($linkData['url']), 'icon' => $this->iconFactory->getIcon('apps-pagetree-page-shortcut-external', Icon::SIZE_SMALL)->render() ]; @@ -408,6 +408,17 @@ class InputLinkElement extends AbstractFormElement return $data; } + /** + * @param string $uriString + * + * @return string + */ + protected function getDomainByUrl(string $uriString): string + { + $data = parse_url($uriString); + return $data['host'] ?? ''; + } + /** * @return LanguageService */ diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js index 0923267dcc9de1d47d245ff7befd68fa811bcbd9..2c622e03db6cbd473898e60f94f5c2d7f8fefbd4 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js @@ -1007,7 +1007,7 @@ define(['jquery', // if empty, show input field $(explanationClass).filter(function () { - return !$.trim($(this).html()); + return !$.trim($(this).val()); }).each(function () { var $group = $(this).closest('.t3js-form-field-inputlink'), $inputField = $group.find(inputFieldClass),