]> git.mxchange.org Git - core.git/commitdiff
Brought loadEmailTemplate() back to life.
authorRoland Haeder <roland@mxchange.org>
Tue, 7 Apr 2015 21:10:27 +0000 (23:10 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 7 Apr 2015 21:10:27 +0000 (23:10 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/interfaces/template/class_CompileableTemplate.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/template/class_BaseTemplateEngine.php

index 4cdd7422c7bd4431a3273d59fc1db8a7348fe31f..d12656878f85a85f83fffa9095bee60d415406a7 100644 (file)
@@ -50,6 +50,16 @@ interface CompileableTemplate extends FrameworkInterface {
         */
        function loadCodeTemplate ($template);
 
         */
        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
         *
        /**
         * Compile all variables by inserting their respective values
         *
index 709945e4b44c3f586c35f67c5fd2fbc569d310bb..db07b20d85a0de511900cc5b0f0dc89bcb68a5fd 100644 (file)
@@ -52,9 +52,7 @@ class BaseMailer extends BaseFrameworkSystem {
                $templatePrefix = $this->getConfigInstance()->getConfigEntry('email_tpl_' . $templateName);
 
                // Load this email template
                $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);
        }
 
        /**
        }
 
        /**
index 68be4dcb037bcc35e979ad63e98999bbb810cca2..ed6f5dd61a238ea1e08490dda141998bc3ed6d38 100644 (file)
@@ -1238,6 +1238,21 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $this->loadTemplate($template);
        }
 
                $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
        /**
         * Compiles configuration place-holders in all variables. This 'walks'
         * through the variable group 'general'. It interprets all values from that