From 038e50272911b5523a430b22d38561b3dc649c14 Mon Sep 17 00:00:00 2001 From: Stefan Neufeind Date: Fri, 5 Feb 2021 16:48:44 +0100 Subject: [PATCH 1/2] [FEATURE] Provide stdWrap-functionality for TypoScript-settings An additional setting useStdWrap is added with a list of fields for which stdWrap-functionality should be applied. This implementation is adapted from EXT:tt_news. --- Classes/Controller/AddressController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Classes/Controller/AddressController.php b/Classes/Controller/AddressController.php index e4d614d4..fa2f9b5c 100755 --- a/Classes/Controller/AddressController.php +++ b/Classes/Controller/AddressController.php @@ -116,6 +116,21 @@ public function injectConfigurationManager(ConfigurationManagerInterface $config $originalSettings[$property] = $tsSettings['settings'][$property]; } + // Use stdWrap for given defined settings + if (isset($originalSettings['useStdWrap']) && !empty($originalSettings['useStdWrap'])) { + $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class); + $typoScriptArray = $typoScriptService->convertPlainArrayToTypoScriptArray($originalSettings); + $stdWrapProperties = GeneralUtility::trimExplode(',', $originalSettings['useStdWrap'], true); + foreach ($stdWrapProperties as $key) { + if (is_array($typoScriptArray[$key . '.'])) { + $originalSettings[$key] = $this->configurationManager->getContentObject()->stdWrap( + $typoScriptArray[$key], + $typoScriptArray[$key . '.'] + ); + } + } + } + // start override if (isset($tsSettings['settings']['overrideFlexformSettingsIfEmpty'])) { $typoScriptUtility = GeneralUtility::makeInstance(TypoScript::class); From 8a557abccce3bcae9f4d07743da30788709b6fc5 Mon Sep 17 00:00:00 2001 From: Stefan Neufeind Date: Fri, 5 Feb 2021 16:59:05 +0100 Subject: [PATCH 2/2] Update AddressController.php --- Classes/Controller/AddressController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Controller/AddressController.php b/Classes/Controller/AddressController.php index fa2f9b5c..ce073dbb 100755 --- a/Classes/Controller/AddressController.php +++ b/Classes/Controller/AddressController.php @@ -124,7 +124,7 @@ public function injectConfigurationManager(ConfigurationManagerInterface $config foreach ($stdWrapProperties as $key) { if (is_array($typoScriptArray[$key . '.'])) { $originalSettings[$key] = $this->configurationManager->getContentObject()->stdWrap( - $typoScriptArray[$key], + $typoScriptArray[$key], $typoScriptArray[$key . '.'] ); }