From aa5d463b8bee339d6f8ff5ba87e0d00ea4e2a20c Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 19 Jul 2007 23:34:42 +0000 Subject: [PATCH] Allow themes to have Includes in there templates git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39035 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/SSViewer.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/SSViewer.php b/core/SSViewer.php index 6718d9fa7..bb6d8e602 100644 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -117,8 +117,15 @@ class SSViewer extends Object { public static function getTemplateFile($identifier) { global $_TEMPLATE_MANIFEST; - if(isset($_TEMPLATE_MANIFEST[$identifier]['Includes'])) return $_TEMPLATE_MANIFEST[$identifier]['Includes']; - else return isset($_TEMPLATE_MANIFEST[$identifier]['main']) ? $_TEMPLATE_MANIFEST[$identifier]['main'] : null; + if(self::$current_theme && isset($_TEMPLATE_MANIFEST[$identifier]['themes'][self::$current_theme]['Includes'])) { + return $_TEMPLATE_MANIFEST[$identifier]['themes'][self::$current_theme]['Includes']; + } else if(isset($_TEMPLATE_MANIFEST[$identifier]['Includes'])){ + return $_TEMPLATE_MANIFEST[$identifier]['Includes']; + } else if(self::$current_theme && isset($_TEMPLATE_MANIFEST[$identifier]['themes'][self::$current_theme]['main'])) { + return $_TEMPLATE_MANIFEST[$identifier]['themes'][self::$current_theme]['main']; + } else { + return isset($_TEMPLATE_MANIFEST[$identifier]['main']) ? $_TEMPLATE_MANIFEST[$identifier]['main'] : null; + } } public static function getTemplateContent($identifier) { return file_get_contents(SSViewer::getTemplateFile($identifier));