Smarty debug for templated mails.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 15 Jun 2008 16:46:35 +0000 (18:46 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 15 Jun 2008 16:46:35 +0000 (18:46 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plmailer.php

index 6b6fd0d..2106d50 100644 (file)
@@ -265,7 +265,10 @@ class PlMailer extends Mail_Mime {
     private function processPage($with_html = true)
     {
         if (!is_null($this->page)) {
-            $level = error_reporting(0);
+            global $globals;
+            if (!($globals->debug & DEBUG_SMARTY)) {
+                $level = error_reporting(0);
+            }
             $this->page->run('head'); // process page headers
             $this->wiki = trim($this->page->run('wiki')); // get wiki
             if (!$this->wiki) {
@@ -277,7 +280,9 @@ class PlMailer extends Mail_Mime {
                     }
                 }
             }
-            error_reporting($level);
+            if (!($globals->debug & DEBUG_SMARTY)) {
+                error_reporting($level);
+            }
         }
         if ($this->wiki) {
             $this->setTxtBody(MiniWiki::WikiToText($this->wiki, false, 0, 78));