diff --git a/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php b/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php index e7a45c2c105f4f6a3507ff6847f061c846e6aa65..92faef10e8ba1a0daee48714b49cc4bc624485ba 100644 --- a/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php +++ b/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php @@ -274,10 +274,10 @@ class ExtendedTemplateService extends TemplateService $marker = substr(md5($matches[0]), 0, 6); switch ($this->constantMode) { case 'const': - $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? '##' . $marker . '_B##' . $matches[0] . '##' . $marker . '_E##' : $matches[0]; + $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? '##' . $marker . '_B##' . $this->flatSetup[$matches[1]] . '##' . $marker . '_M##' . $matches[0] . '##' . $marker . '_E##' : $matches[0]; break; case 'subst': - $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? '##' . $marker . '_B##' . $this->flatSetup[$matches[1]] . '##' . $marker . '_E##' : $matches[0]; + $ret_val = isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? '##' . $marker . '_B##' . $matches[0] . '##' . $marker . '_M##' . $this->flatSetup[$matches[1]] . '##' . $marker . '_E##' : $matches[0]; break; case 'untouched': $ret_val = $matches[0]; @@ -289,7 +289,8 @@ class ExtendedTemplateService extends TemplateService } /** - * Substitute markers + * Substitute markers added in substituteConstantsCallBack() + * with ##6chars_B##value1##6chars_M##value2##6chars_E## * * @param string $all * @return string @@ -300,9 +301,9 @@ class ExtendedTemplateService extends TemplateService case 'const': case 'subst': $all = preg_replace( - '/##[a-z0-9]{6}_B##((?:(?!##[a-z0-9]{6}_E##).)+)?##[a-z0-9]{6}_E##/', - '<strong style="color: green;">$1</strong>', - $all + '/##[a-z0-9]{6}_B##(.*?)##[a-z0-9]{6}_M##(.*?)##[a-z0-9]{6}_E##/', + '<strong class="text-success" data-toggle="tooltip" data-placement="top" data-title="$1" title="$1">$2</strong>', + $all ); break; default: @@ -312,7 +313,7 @@ class ExtendedTemplateService extends TemplateService /** * Parse constants with respect to the constant-editor in this module. - * In particular comments in the code are registered. + * In particular comments in the code are registered and the edit_divider is taken into account. * * @return array */ diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-40729-TitleAttributeForUnsubstitutedConstantsInTSObjectBrowser.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-40729-TitleAttributeForUnsubstitutedConstantsInTSObjectBrowser.rst new file mode 100644 index 0000000000000000000000000000000000000000..160af30376d072016df8632919f1b6c28b509df2 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-40729-TitleAttributeForUnsubstitutedConstantsInTSObjectBrowser.rst @@ -0,0 +1,28 @@ +.. include:: ../../Includes.txt + +==================================================================================== +Feature: #40729 - Title attribute for (un)substituted constants in TS object browser +==================================================================================== + +See :issue:`40729` + +Description +=========== + +The TypoScript object browser Backend Module comes now with a tiny improvement for +the "(un)substituted constants" view. +When hovering over an item in the object browser, the constant name will be shown when in +"substituted constants in green" mode, or the constant value when in "unsubstituted constants in +green" mode. + +This way one doesn't necessarily have to toggle between the two "green modes". + + +Impact +====== + +Less toggling between the two "contants in green" modes while using the TS object browser. +And as a side effect this patch improves the search feature of the object browser when searching +for a constant value or name, i.e. 'maxWInText' while being on "substituted" mode. + +.. index:: Backend, TypoScript diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php index 7db4bdbc0e5d4d4f62fa2ca322869895851bfddc..e556f6cb6d95c09424aa5b75f76429147335a9ff 100644 --- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php +++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php @@ -377,7 +377,8 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu } // Ending section displayoptions } - + $this->getPageRenderer(); + $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Tooltip'); $view = GeneralUtility::makeInstance(StandaloneView::class); $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName( 'EXT:tstemplate/Resources/Private/Templates/TemplateObjectBrowserModuleFunction.html'