logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: squirrelmail/class/template template.class.php, 1.17, 1.18: msg#00070

Subject: CVS: squirrelmail/class/template template.class.php, 1.17, 1.18
Update of /cvsroot/squirrelmail/squirrelmail/class/template
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8224/class/template

Modified Files:
        template.class.php 
Log Message:
Forgot to check default template set before falling back to plugin default 
template for plugin t12n

Index: template.class.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/class/template/template.class.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- template.class.php  21 Sep 2006 12:51:27 -0000      1.17
+++ template.class.php  21 Sep 2006 13:25:09 -0000      1.18
@@ -267,20 +267,28 @@
      *
      * Find the right template file.
      *
-     * Templates are expected to be found in the template set directory
-     * (for example SM_PATH/templates/<template name>/) or, in the case
-     * of plugin templates, in a plugin directory in the template set
-     * directory (for example, 
-     * SM_PATH/templates/<template name>/plugins/<plugin name>/) *OR* in 
-     * a template directory in the plugin as a fallback (for example,
-     * SM_PATH/plugins/<plugin name>/templates/<template name>/).  If 
-     * the correct file is not found for the current template set, a 
+     * Templates are expected to be found in the template set directory,
+     * for example:
+     *     SM_PATH/templates/<template name>/
+     * or, in the case of plugin templates, in a plugin directory in the 
+     * template set directory, for example:
+     *     SM_PATH/templates/<template name>/plugins/<plugin name>/
+     * *OR* in a template directory in the plugin as a fallback, for example:
+     *     SM_PATH/plugins/<plugin name>/templates/<template name>/
+     * If the correct file is not found for the current template set, a 
      * default template is loaded, which is expected to be found in the 
-     * default template directory (for example, SM_PATH/templates/default/)
-     * or for plugins, in a plugin directory in the default template set
-     * (for example, SM_PATH/templates/default/plugins/<plugin name>/),
-     * *OR* in a default template directory in the plugin as a fallback
-     * (for example, SM_PATH/plugins/<plugin name>/templates/default/).
+     * default template directory, for example:
+     *     SM_PATH/templates/default/
+     * or for plugins, in a plugin directory in the default template set,
+     * for example:
+     *     SM_PATH/templates/default/plugins/<plugin name>/
+     * *OR* in a default template directory in the plugin as a fallback,
+     * for example:
+     *     SM_PATH/plugins/<plugin name>/templates/default/
+     *
+     * Plugin authors must note that the $filename MUST be prefaced
+     * with "plugins/<plugin name>/" in order to correctly resolve the 
+     * template file.
      *
      * @param string $filename The name of the template file,
      *                         possibly prefaced with 
@@ -313,8 +321,16 @@
                           . $this->get_template_file_directory() 
                           . substr($filename, strlen($plugin_name) + 9);
 
-                // no go, we have to get the default template
-                // from the plugin
+                // no go, we have to get the default template, 
+                // first try the default SM template
+                //
+                if (!file_exists($filepath)) {
+
+                    $filepath = SM_PATH 
+                              . $this->get_default_template_file_directory() 
+                              . $filename;
+
+                    // still no luck?  get default template from the plugin
                 //
                 if (!file_exists($filepath)) {
 
@@ -330,6 +346,8 @@
 
                 }
 
+                }
+
 
             // get default template for non-plugin templates
             //


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>