Change message/rfc822 save file extension
[squirrelmail.git] / class / template / Template.class.php
index c43e04aeb886b94aa06f63bf0037a5f009485bfb..31244fd6eb60fad81e4f070588803b7d2d774206 100644 (file)
@@ -8,7 +8,7 @@
   * class with any custom functionality needed to interface a target
   * templating engine with SquirrelMail.
   *
-  * @copyright © 2003-2006 The SquirrelMail Project Team
+  * @copyright © 2003-2007 The SquirrelMail Project Team
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
   * @version $Id$
   * @package squirrelmail
@@ -712,6 +712,8 @@ class Template
       * are catalogued; for identically named files, the file earlier
       * in the hierarchy (closest to this template set) is used.
       *
+      * Refuses to traverse directories called ".svn"
+      *
       * @param string $template_set_id The template set in which to
       *                                search for files
       * @param array  $file_list       The file list so far to be added
@@ -743,6 +745,12 @@ class Template
             $directory = $template_base_dir;
         }
 
+
+        // bail if we have been asked to traverse a Subversion directory
+        //
+        if (strpos($directory, '/.svn') === strlen($directory) - 5) return $file_list;
+
+
         $files_and_dirs = list_files($directory, '', FALSE, TRUE, FALSE, TRUE);
 
         // recurse for all the subdirectories in the template set
@@ -1186,9 +1194,10 @@ class Template
         $return_array = array();
         foreach ($css_directories as $directory) {
 
-            // CVS directories are not wanted
+            // CVS and SVN directories are not wanted
             //
-            if (strpos($directory, '/CVS') === strlen($directory) - 4) continue;
+            if ((strpos($directory, '/CVS') === strlen($directory) - 4)
+             || (strpos($directory, '/.svn') === strlen($directory) - 5)) continue;
 
             $pretty_name = ucwords(str_replace('_', ' ', basename($directory)));
 
@@ -1316,7 +1325,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 +1338,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'));
         }
 
     }
@@ -1410,9 +1420,9 @@ FIXME: We could make the incoming array more complex so it can
         } else {
 
             $aPluginOutput = array();
+            $temp = array(&$aPluginOutput, &$this);
             $aPluginOutput = concat_hook_function('template_construct_' . $file,
-                                                  $temp=array(&$aPluginOutput, &$this),
-                                                  TRUE);
+                                                  $temp, TRUE);
             $this->assign('plugin_output', $aPluginOutput);
 
             //$output = $this->apply_template($template);