From ce539d82c49c7e739d8c8dd179cb503ce994c4ef Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 Sep 2014 14:09:10 -0700 Subject: [PATCH] Mailing now considered to be 'frontend' when loading templates. Fixes consistency issues. (eg. login notifications etc.) --- e107_handlers/e107_class.php | 2 +- e107_handlers/e_parse_class.php | 2 +- e107_handlers/mail.php | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 33e370bba..ca9d3c1e4 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1996,7 +1996,7 @@ class e107 * * @param string $id - file prefix, e.g. user for user_template.php * @param string|null $key - * @param boolean $override see {@link getThemeInfo()} + * @param mixed $override see {@link getThemeInfo()} true/false, front or admin. * @param boolean $merge merge theme with core templates, default is false * @param boolean $info retrieve template info only * @return string|array diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index ab5d0966b..66253db74 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2093,7 +2093,7 @@ class e_parse extends e_parser 'e_HANDLER/' => '{e_HANDLER}', // BC 'e_MEDIA/' => '{e_MEDIA}', 'e_WEB/' => '{e_ADMIN}', - 'THEME/' => '{THEME}', + // 'THEME/' => '{THEME}', ); diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php index 1be3ac1dc..4e76e6900 100644 --- a/e107_handlers/mail.php +++ b/e107_handlers/mail.php @@ -155,6 +155,7 @@ class e107Email extends PHPMailer public $legacyBody = false; // TRUE enables legacy conversion of plain text body to HTML in HTML emails private $debug = false; // echos various debug info when set to true. + private $pref = array(); // Store code prefs. /** * Constructor sets up all the global options, and sensible defaults - it should be the only place the prefs are accessed @@ -175,6 +176,8 @@ class e107Email extends PHPMailer { $this->debug = true; } + + $this->pref = $pref; $this->CharSet = 'utf-8'; $this->SetLanguage(CORE_LC); @@ -606,14 +609,11 @@ class e107Email extends PHPMailer { - if($tmpl = e107::getCoreTemplate('email', $eml['template'], true, true)) //FIXME - Core template is failing with template 'notify'. Works with theme template. Issue with core template registry? - { - // $filter = array("\n", "\t"); - // $tmpl['header'] = str_replace($filter,'', $tmpl['header']); - // $tmpl['footer'] = str_replace($filter,'', $tmpl['footer']); - - $eml['shortcodes']['BODY'] = $eml['email_body']; - $eml['shortcodes']['SUBJECT'] = $eml['email_subject']; + if($tmpl = e107::getCoreTemplate('email', $eml['template'], 'front', true)) //FIXME - Core template is failing with template 'notify'. Works with theme template. Issue with core template registry? + { + $eml['shortcodes']['BODY'] = $eml['email_body']; + $eml['shortcodes']['SUBJECT'] = $eml['email_subject']; + $eml['shortcodes']['THEME'] = e_THEME.$this->pref['sitetheme'].'/'; // Always use front-end theme path. $emailBody = $tmpl['header']. $tmpl['body'] . $tmpl['footer'];