BUGFIX: static publishing now uses the last non-null theme, OR the value defined in StaticPublisher::static_publisher_theme. (from r103255)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112130 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-13 03:40:05 +00:00
parent 9f61d51635
commit 49496e5c4b

View File

@ -87,6 +87,11 @@ class SSViewer {
*/
protected static $current_theme = null;
/**
* @var string
*/
protected static $current_custom_theme = null;
/**
* Create a template from a string instead of a .ss file
*
@ -101,6 +106,9 @@ class SSViewer {
*/
static function set_theme($theme) {
self::$current_theme = $theme;
//Static publishing needs to have a theme set, otherwise it defaults to the content controller theme
if(!is_null($theme))
self::$current_custom_theme=$theme;
}
/**
@ -110,6 +118,13 @@ class SSViewer {
return self::$current_theme;
}
/**
* @return string
*/
static function current_custom_theme(){
return self::$current_custom_theme;
}
/**
* Pass the SilverStripe template to be used.
*
@ -904,4 +919,4 @@ function supressOutput() {
return "";
}
?>
?>