Allow template sets to filter or completely change header delivery
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 9 Jan 2007 08:03:54 +0000 (08:03 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 9 Jan 2007 08:03:54 +0000 (08:03 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12108 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/template/Template.class.php
templates/default/header.tpl [new file with mode: 0644]

index c43e04aeb886b94aa06f63bf0037a5f009485bfb..df6cc7a80b3a4696e9bd9e2fe7fd35f3d958431d 100644 (file)
@@ -1316,7 +1316,7 @@ FIXME: We could make the incoming array more complex so it can
       * Send HTTP header(s) to browser.
       *
       * Subclasses can override this function if headers are
-      * managed differently in the template set's target output
+      * managed differently in the engine's target output
       * interface.
       *
       * @param mixed $headers A list of (or a single) header
@@ -1329,7 +1329,8 @@ FIXME: We could make the incoming array more complex so it can
         if (!is_array($headers)) $headers = array($headers);
 
         foreach ($headers as $header) {
-            header($header);
+            $this->assign('header', $header);
+            header($this->fetch('header.tpl'));
         }
 
     }
diff --git a/templates/default/header.tpl b/templates/default/header.tpl
new file mode 100644 (file)
index 0000000..45b1d05
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+/**
+  * header.tpl
+  *
+  * Template for constructing a header that is sent to the browser.
+  *
+  * The following variables are available in this template:
+  *      + $header - The header string to be sent
+  *
+  * @copyright &copy; 1999-2006 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id$
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+echo $header;
+
+