diff --git a/Classes/Controller/ConfigurationController.php b/Classes/Controller/ConfigurationController.php index e43eaeaee2373965283c15f0a9f29002907f79b9..ef71a37f8334ab36368cd6a58922395bd8b44068 100644 --- a/Classes/Controller/ConfigurationController.php +++ b/Classes/Controller/ConfigurationController.php @@ -87,11 +87,18 @@ class ConfigurationController extends ActionController { $this->view->assign('mode', $mode); if ($mode === 'edit') { $templateToEdit = $registerArray[$selectedExtension][$selectedTemplate]; + $editableMarkers = []; + foreach ($templateToEdit['marker'] as $arr) { + $editableMarkers[] = [ + 'identifier' => $arr['marker'] . ',' . $arr['markerLabel'], + 'value' => $arr['value'], + 'description' => $arr['description'] + ]; + } $csv = ''; - foreach ($templateToEdit['marker'] as $arr) { + foreach ($editableMarkers as $arr) { $csv .= implode(';', $arr) . "\r\n"; - } $this->view->assignMultiple( @@ -162,10 +169,15 @@ class ConfigurationController extends ActionController { if (!$rowArray[0]) { continue; } + + $markerArray = GeneralUtility::trimExplode(',', $rowArray[0], FALSE, 2); + $markerName = $markerArray[0]; + $markerLabel = $markerArray[1] ?? $markerName; $markers[] = [ - 'identifier' => $rowArray[0], + 'identifier' => $markerName, 'value' => $rowArray[1], - 'description' => $rowArray[2] + 'description' => $rowArray[2], + 'markerLabel' => $markerLabel ]; } @@ -226,10 +238,15 @@ class ConfigurationController extends ActionController { if (!$rowArray[0]) { continue; } + + $markerArray = GeneralUtility::trimExplode(',', $rowArray[0], FALSE, 2); + $markerName = $markerArray[0]; + $markerLabel = $markerArray[1] ?? $markerName; $markers[] = [ 'identifier' => $rowArray[0], 'value' => $rowArray[1], - 'description' => $rowArray[2] + 'description' => $rowArray[2], + 'markerLabel' => $markerLabel ]; } diff --git a/Classes/Service/MailTemplateService.php b/Classes/Service/MailTemplateService.php index 5384b27a9408858ef640d95fd6217a55a9a3a712..b9ffb87c6f0edf3d97749231cccbd45159a29c63 100644 --- a/Classes/Service/MailTemplateService.php +++ b/Classes/Service/MailTemplateService.php @@ -346,6 +346,13 @@ class MailTemplateService { */ public function setMarkers(array $markers): MailTemplateService { $this->markers = $markers; + foreach($markers as $key => $currentMarker) { + if (!isset($currentMarker['markerLabel'])) { + continue; + } + $this->markerLabels[$key] = $currentMarker['markerLabel']; + } + return $this; } @@ -614,6 +621,10 @@ class MailTemplateService { $temporaryMarkerArray = []; foreach (array_reverse($markerPath) as $index => $markerPathSegment) { if ($index === 0) { + if ($marker['markerLabel']) { + $markerPathSegment = $marker['markerLabel']; + } + if ($marker['backend_translation_key']) { $temporaryMarkerArray[$markerPathSegment] = LocalizationUtility::translate( $marker['backend_translation_key'], $marker['extension_key'] diff --git a/Classes/Service/RegisterService.php b/Classes/Service/RegisterService.php index 3fcf7da6a8f11bdf98378643b265886d9dcadd05..52f44269f3d73adf703f4c3f7e42c2db6b958bf9 100644 --- a/Classes/Service/RegisterService.php +++ b/Classes/Service/RegisterService.php @@ -254,6 +254,9 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { foreach ($markers as $marker) { $markerName = $marker['identifier']; + $markerArray = GeneralUtility::trimExplode(',', $markerName, FALSE, 2); + $markerName = $markerArray[0]; + $newRegisterArray['markers'][] = [ 'marker' => $markerName, 'type' => MailTemplateService::MARKER_TYPE_STRING,