From: Roland Haeder Date: Tue, 7 Apr 2015 21:10:27 +0000 (+0200) Subject: Brought loadEmailTemplate() back to life. X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=eceddfea4c386fff2760fa6f3592a242809cbf7a Brought loadEmailTemplate() back to life. Signed-off-by: Roland Häder --- diff --git a/inc/classes/interfaces/template/class_CompileableTemplate.php b/inc/classes/interfaces/template/class_CompileableTemplate.php index 4cdd7422..d1265687 100644 --- a/inc/classes/interfaces/template/class_CompileableTemplate.php +++ b/inc/classes/interfaces/template/class_CompileableTemplate.php @@ -50,6 +50,16 @@ interface CompileableTemplate extends FrameworkInterface { */ function loadCodeTemplate ($template); + /** + * Load a specified email template into the engine for later compilation + * with other code/web/email templates. + * + * @param $template The email template we shall load which is + * located in "html" by default + * @return void + */ + function loadEmailTemplate ($template); + /** * Compile all variables by inserting their respective values * diff --git a/inc/classes/main/mailer/class_BaseMailer.php b/inc/classes/main/mailer/class_BaseMailer.php index 709945e4..db07b20d 100644 --- a/inc/classes/main/mailer/class_BaseMailer.php +++ b/inc/classes/main/mailer/class_BaseMailer.php @@ -52,9 +52,7 @@ class BaseMailer extends BaseFrameworkSystem { $templatePrefix = $this->getConfigInstance()->getConfigEntry('email_tpl_' . $templateName); // Load this email template - // @TODO This needs testing/fixes because the deprecated method - // loadEmailTemplate() has been removed from interface CompileableTemplate. - $this->getTemplateInstance()->loadCodeTemplate($templatePrefix . '_' . $templateName); + $this->getTemplateInstance()->loadEmailTemplate($templatePrefix . '_' . $templateName); } /** diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 68be4dcb..ed6f5dd6 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -1238,6 +1238,21 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $this->loadTemplate($template); } + /** + * Load a specified email template into the engine + * + * @param $template The email template we shall load which is + * located in 'emails' by default + * @return void + */ + public function loadEmailTemplate ($template) { + // Set template type + $this->setTemplateType($this->getConfigInstance()->getConfigEntry('email_template_type')); + + // Load the special template + $this->loadTemplate($template); + } + /** * Compiles configuration place-holders in all variables. This 'walks' * through the variable group 'general'. It interprets all values from that