Commit 1bf96ddd authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Adding a function to determine if a single template is blacklisted for the siteroot

parent b38d8d02
......@@ -451,7 +451,7 @@ class MailTemplateService {
* @return MailTemplateService
*/
public function setToAddresses($toAddresses) {
$toAddresses = preg_replace('~\x{00a0}~siu',' ', $toAddresses);
$toAddresses = preg_replace('~\x{00a0}~siu', ' ', $toAddresses);
$this->toAddresses = trim($toAddresses);
$this->mailMessage->setTo(trim($toAddresses));
return $this;
......@@ -687,7 +687,7 @@ class MailTemplateService {
* @throws \BadFunctionCallException
* @return array
*/
public static function registerExtensions() {
public static function registerExtensions(): array {
// clear registerArray
$registerArray = [];
......@@ -735,4 +735,25 @@ class MailTemplateService {
return $registerArray;
}
/**
* Checks if a template is blacklisted for a given siterootId
*
* @param string $extensionKey
* @param string $templateName
* @param int $siteRootId
* @return boolean
* @throws \InvalidArgumentException
* @throws \BadFunctionCallException
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
public static function isTemplateBlacklisted($extensionKey, $templateName, $siteRootId): bool {
$whitelistedTemplates = BackendService::getWhitelistedTemplates($siteRootId);
if ($whitelistedTemplates[$extensionKey]) {
return $whitelistedTemplates[$extensionKey][$templateName] ? FALSE : TRUE;
}
return TRUE;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment