mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
97ff1db6f9
commit
aa5d463b8b
@ -117,8 +117,15 @@ class SSViewer extends Object {
|
|||||||
|
|
||||||
public static function getTemplateFile($identifier) {
|
public static function getTemplateFile($identifier) {
|
||||||
global $_TEMPLATE_MANIFEST;
|
global $_TEMPLATE_MANIFEST;
|
||||||
if(isset($_TEMPLATE_MANIFEST[$identifier]['Includes'])) return $_TEMPLATE_MANIFEST[$identifier]['Includes'];
|
if(self::$current_theme && isset($_TEMPLATE_MANIFEST[$identifier]['themes'][self::$current_theme]['Includes'])) {
|
||||||
else return isset($_TEMPLATE_MANIFEST[$identifier]['main']) ? $_TEMPLATE_MANIFEST[$identifier]['main'] : null;
|
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) {
|
public static function getTemplateContent($identifier) {
|
||||||
return file_get_contents(SSViewer::getTemplateFile($identifier));
|
return file_get_contents(SSViewer::getTemplateFile($identifier));
|
||||||
|
Loading…
Reference in New Issue
Block a user