[geeklog-hg] geeklog: Updated CTL_plugin_themeFindFile function to include ch...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Jul 21 10:36:07 EDT 2015


changeset 9616:239c3096e8de
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/239c3096e8de
user: Tom
date: Tue Jul 21 10:35:25 2015 -0400
description:
Updated CTL_plugin_themeFindFile function to include checking for default theme path if the current theme has a default specified

diffstat:

 system/lib-template.php |  68 ++++++++++++++++++++++++++++++------------------
 1 files changed, 43 insertions(+), 25 deletions(-)

diffs (88 lines):

diff -r cf7f65a3ee01 -r 239c3096e8de system/lib-template.php
--- a/system/lib-template.php	Thu Jul 16 21:31:17 2015 +0900
+++ b/system/lib-template.php	Tue Jul 21 10:35:25 2015 -0400
@@ -176,9 +176,11 @@
 * - theme path/plugin/file
 * - html path/plugin/directory/file
 * - html path/plugin/directory/theme/file
+* - html path/plugin/directory/theme_default/file * if default theme exists
 * - html path/plugin/directory/default/file
 * - html path/plugin/file (url path only)
 * - plugin path/plugin/directory/theme/file (physical path only)
+* - plugin path/plugin/directory/theme_default/file (physical path only) * if default theme exists
 * - plugin path/plugin/directory/default/file (physical path only)
 *
 * @param    string  $plugin     name of plugin
@@ -212,31 +214,47 @@
 				$retval = $file;
 			}
         } else {
-            // Use default templates then. This should always exist
-            $file = "{$_CONF['path_html']}/$plugin/$directory/default/$filename";
-            if (file_exists($file)) {
-            	if ($return_url) {
-            		$retval = "/$plugin/$directory/default/$filename";
-				} else {
-					$retval = $file;
-				}
-            } else {
-            	if ($return_url) {
-					// Last guess for URL file location
-					$retval = "/$plugin/$filename";
-				} else {
-					// See if current theme templates stored with plugin
-					$file = "{$_CONF['path']}plugins/$plugin/$directory/{$_CONF['theme']}/$filename";
-					if (file_exists($file)) {
-						$retval = $file;
-					} else {
-						// Use default templates then. This should always exist
-						$file = "{$_CONF['path']}plugins/$plugin/$directory/default/$filename";
-						if (file_exists($file)) {
-							$retval = $file;
-						}
-					}
-				}
+            // Check to see if theme has theme_default. If so check there
+            $file = "{$_CONF['path_html']}/$plugin/$directory/{$_CONF['theme_default']}/$filename";
+            if (!empty($_CONF['theme_default']) AND file_exists($file)) {
+                if ($return_url) {
+                    $retval = "/$plugin/$directory/{$_CONF['theme_default']}/$filename";
+                } else {
+                    $retval = $file;
+                }
+            } else {        
+                // Use default templates then. This should always exist
+                $file = "{$_CONF['path_html']}/$plugin/$directory/default/$filename";
+                if (file_exists($file)) {
+                    if ($return_url) {
+                        $retval = "/$plugin/$directory/default/$filename";
+                    } else {
+                        $retval = $file;
+                    }
+                } else {
+                    if ($return_url) {
+                        // Last guess for URL file location
+                        $retval = "/$plugin/$filename";
+                    } else {
+                        // See if current theme templates stored with plugin
+                        $file = "{$_CONF['path']}plugins/$plugin/$directory/{$_CONF['theme']}/$filename";
+                        if (file_exists($file)) {
+                            $retval = $file;
+                        } else {
+                            // Check to see if theme has theme_default. If so check there
+                            $file = "{$_CONF['path']}plugins/$plugin/$directory/{$_CONF['theme_default']}/$filename";
+                            if (!empty($_CONF['theme_default']) AND file_exists($file)) {
+                                $retval = $file;
+                            } else {        
+                                // Use default templates then. This should always exist
+                                $file = "{$_CONF['path']}plugins/$plugin/$directory/default/$filename";
+                                if (file_exists($file)) {
+                                    $retval = $file;
+                                }
+                            }
+                        }
+                    }
+                }
             }
         }
     }



More information about the geeklog-cvs mailing list