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

[TASK] Adding default language label, register code in correct place

parent c6b8dc94
No related branches found
No related tags found
1 merge request!3New version 4 1
...@@ -106,6 +106,7 @@ class MailController extends ActionController { ...@@ -106,6 +106,7 @@ class MailController extends ActionController {
// if no templates are in the db, get the default from the files // if no templates are in the db, get the default from the files
$templates = []; $templates = [];
$subject = $registerArray[$parameters['selectedExtension']][$parameters['selectedTemplate']]['subject']; $subject = $registerArray[$parameters['selectedExtension']][$parameters['selectedTemplate']]['subject'];
/** @var Template $template */
foreach ($templatesFromDb as $key => $template) { foreach ($templatesFromDb as $key => $template) {
if ($template === NULL) { if ($template === NULL) {
$defaultTemplatePath = $registerArray[$parameters['selectedExtension']][$parameters['selectedTemplate']]['templatePath']; $defaultTemplatePath = $registerArray[$parameters['selectedExtension']][$parameters['selectedTemplate']]['templatePath'];
...@@ -183,6 +184,27 @@ class MailController extends ActionController { ...@@ -183,6 +184,27 @@ class MailController extends ActionController {
$this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent()); $this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
$this->view->assign('typo3Version', VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version)); $this->view->assign('typo3Version', VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version));
$this->view->assign('beUserMail', $GLOBALS['BE_USER']->user['email']); $this->view->assign('beUserMail', $GLOBALS['BE_USER']->user['email']);
// get the default language label and pass it to the view
$languageService = $GLOBALS['LANG'];
$pageTsConfig = BackendUtility::getPagesTSconfig($pageUid);
if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 8000000) {
$defaultLanguageLabel = $languageService->sL(
'LLL:EXT:lang/Resources/Private/Language/locallang_mod_web_list.xlf:defaultLanguage'
);
} else {
$defaultLanguageLabel = $languageService->sL(
'lll:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage'
);
}
if (isset($pageTsConfig['mod.']['SHARED.']['defaultLanguageLabel'])) {
$defaultLanguageLabel = $pageTsConfig['mod.']['SHARED.']['defaultLanguageLabel'] . ' (' . $languageService->sL(
$defaultLanguageLabel
) . ')';
}
$this->view->assign('defaultLanguageLabel', $defaultLanguageLabel);
} }
/** /**
......
...@@ -90,7 +90,14 @@ ...@@ -90,7 +90,14 @@
<f:for each="{languageLabels}" as="label" key="innerKey"> <f:for each="{languageLabels}" as="label" key="innerKey">
<f:if condition="{key} == {innerKey}"> <f:if condition="{key} == {innerKey}">
<h3> <h3>
{label} <f:if condition="{key}=='default'">
<f:then>
{defaultLanguageLabel}
</f:then>
<f:else>
{label}
</f:else>
</f:if>
<f:if condition="{languageTemplate.isOverwritten}"> <f:if condition="{languageTemplate.isOverwritten}">
<f:translate key="backend.is_overwritten" /> <f:translate key="backend.is_overwritten" />
</f:if> </f:if>
......
...@@ -45,3 +45,5 @@ if (TYPO3_MODE === 'BE') { ...@@ -45,3 +45,5 @@ if (TYPO3_MODE === 'BE') {
$tsPath = $extPath . 'Configuration/TypoScript/'; $tsPath = $extPath . 'Configuration/TypoScript/';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(file_get_contents($tsPath . 'setup.ts')); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(file_get_contents($tsPath . 'setup.ts'));
} }
\SGalinski\SgMail\Service\MailTemplateService::registerExtensions();
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