Skip to content
Snippets Groups Projects
Commit 8fc58ba6 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing issues with the manual registrations

parent cef31dd1
No related branches found
No related tags found
No related merge requests found
......@@ -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
];
}
......
......@@ -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']
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment