diff --git a/Classes/Controller/MailController.php b/Classes/Controller/MailController.php index 2b92a1cc437cce92525d99f069436f7fc60e21f1..76fc1ecac308f31b2badc17d6ed73c8be5b1d2aa 100644 --- a/Classes/Controller/MailController.php +++ b/Classes/Controller/MailController.php @@ -97,6 +97,28 @@ class MailController extends ActionController { } $registerArray = MailTemplateService::getRegisterArray(); + $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sg_mail']); + if (isset($extensionConfiguration['excludeTemplates']) && $extensionConfiguration['excludeTemplates'] !== '') { + $excludedTemplates = GeneralUtility::trimExplode(',', $extensionConfiguration['excludeTemplates'], TRUE); + if ($excludedTemplates && count($excludedTemplates)) { + foreach ($excludedTemplates as $excludedTemplate) { + list($extensionKey, $templateName) = GeneralUtility::trimExplode('.', $excludedTemplate); + if ($extensionKey && $templateName && isset($registerArray[$extensionKey][$templateName])) { + unset($registerArray[$extensionKey][$templateName]); + } + } + } + } + $removeExtensionKeys = []; + foreach ($registerArray as $extensionKey => $extensionTemplates) { + if (count($extensionTemplates) === 0) { + $removeExtensionKeys[] = $extensionKey; + } + } + foreach ($removeExtensionKeys as $extensionKey) { + unset($registerArray[$extensionKey]); + } + reset($registerArray); // if no extensions are registered, redirect to empty action if (empty($registerArray)) { @@ -169,7 +191,7 @@ class MailController extends ActionController { $this->view->assign('colspace', $colspace); $this->view->assign('languageTemplates', $templates); $this->view->assign('languageLabels', BackendService::getLanguageLabels($languages)); - $this->view->assign('templates', MailTemplateService::getRegisterArray()); + $this->view->assign('templates', $registerArray); $templateDescription = $registerArray[$parameters['selectedExtension']][$parameters['selectedTemplate']]['description']; diff --git a/README.md b/README.md index 6d5557a7efdd0a8370b7bfebd01c398148c00b54..8aad1be20a4a8e62860556d12f519f25b46552b6 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,9 @@ With the **Mail Queue** mode, you can see the current content of your mailing qu Additionally you can now filter the mail queue or export it to a csv file. +## Known Facts + +### Countries aren't respected yet. Currently just languages are used. ## Developer Guide diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 6a0a6b481d4daaae639023fb50f735a7c4b44b6c..4f5d3f63b308e000560ee42fcff390ad972931e9 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -313,6 +313,10 @@ <source>Example</source> <target>Beispiel</target> </trans-unit> + <trans-unit id="configuration.excludeTemplates"> + <source>Exclude Mail Templates:Comma-separated list of {extension_key}.{template_name}</source> + <target>Mail-Templates ausschließen:Kommagetrennte Liste von {extension_key}.{template_name}</target> + </trans-unit> <trans-unit id="mlang_labels_tabdescr" approved="yes"> <source>Mail Templates</source> <target>Mail-Templates</target> diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index dbccc1c03160909db492e13bdefa2b796b077d13..1cdb88e18b82248970f67ee0c202fd125ecb4697 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -237,6 +237,9 @@ <trans-unit id="backend.value"> <source>Example</source> </trans-unit> + <trans-unit id="configuration.excludeTemplates"> + <source>Exclude Mail Templates:Comma-separated list of {extension_key}.{template_name}</source> + </trans-unit> <trans-unit id="mlang_labels_tabdescr"> <source>Mail Templates</source> </trans-unit> diff --git a/composer.json b/composer.json index 36e9211231d15e1a89de7300af6929afaeb26a8a..537879cd7f59b05c2b90f4232bd91c210839871e 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "license": [ "GPL-2.0+" ], - "version": "4.1.3", + "version": "4.2.1", "repositories": [ { "type": "composer", diff --git a/ext_conf_template.txt b/ext_conf_template.txt new file mode 100644 index 0000000000000000000000000000000000000000..5eee4dc177e0146d29cb88e4e209a21d4c086193 --- /dev/null +++ b/ext_conf_template.txt @@ -0,0 +1,2 @@ +# cat=general; type=string; label=LLL:EXT:sg_mail/Resources/Private/Language/locallang.xlf:configuration.excludeTemplates +excludeTemplates = diff --git a/ext_emconf.php b/ext_emconf.php index d45b8e90037d61ab4abfe3d6378fd4c2656735c7..dc0a0108785d093b2c5e393d5f56939d58aea833 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -8,7 +8,7 @@ $EM_CONF['sg_mail'] = array ( 'title' => 'Mail Templates', 'description' => 'Mail Templates', 'category' => 'module', - 'version' => '4.1.3', + 'version' => '4.2.1', 'state' => 'stable', 'uploadfolder' => false, 'createDirs' => '',