Commit 172cf6cf authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing issues with automatic registration when reading the html template path

parent 3b011401
......@@ -835,7 +835,10 @@ class MailTemplateService {
if ($configArray) {
foreach ($configArray as $key => $config) {
$registerArray = self::writeRegisterArrayEntry($registerArray, $config['extensionKey'], $config['extensionKey'], $config['templateKey'], $config);
$registerArray = self::writeRegisterArrayEntry(
$registerArray, $config['extensionKey'], $config['extensionKey'], $config['templateKey'],
$config, FALSE, 'project_theme'
);
}
}
......@@ -852,20 +855,35 @@ class MailTemplateService {
* @param string $extensionKey
* @param string $templateKey
* @param array $configArray
* @param bool $transformTemplateFolder
* @param string $storeTemplateExtension
* @return array
*/
private static function writeRegisterArrayEntry(
array $registerArray, $extensionName, $extensionKey, $templateKey, array $configArray
array $registerArray, $extensionName, $extensionKey, $templateKey, array $configArray,
$transformTemplateFolder = TRUE, $storeTemplateExtension = ''
) {
// transform template directory name: your_templates => YourTemplates/
$templateDirectoryParts = GeneralUtility::trimExplode('_', $templateKey);
$templateDirectory = '';
foreach ($templateDirectoryParts as $part) {
$templateDirectory .= ucfirst($part);
// If it is not explicitly set in which extension the html should be located, use the extension set in the template settings
if ($storeTemplateExtension === '') {
$storeTemplateExtension = $extensionKey;
}
// give the option to use the template key as folder name. this is used mainly with auto registering
$templateDirectory = $templateKey;
// by default folders with underscore will be transformed to upper camelcase
if ($transformTemplateFolder) {
// transform template directory name: your_templates => YourTemplates/
$templateDirectoryParts = GeneralUtility::trimExplode('_', $templateKey);
$templateDirectory = '';
foreach ($templateDirectoryParts as $part) {
$templateDirectory .= ucfirst($part);
}
}
$templateDirectory .= '/';
$templatePath = ExtensionManagementUtility::extPath(
$extensionName
$storeTemplateExtension
) . self::DEFAULT_TEMPLATE_PATH . $templateDirectory;
if ($configArray['template_path']) {
......
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