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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103255 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2010-04-21 05:13:02 +00:00 committed by Sam Minnee
parent 9e8523fcf1
commit 2518421b64

View File

@ -87,6 +87,11 @@ class SSViewer {
*/ */
protected static $current_theme = null; protected static $current_theme = null;
/**
* @var string
*/
protected static $current_custom_theme = null;
/** /**
* Create a template from a string instead of a .ss file * Create a template from a string instead of a .ss file
* *
@ -101,6 +106,9 @@ class SSViewer {
*/ */
static function set_theme($theme) { static function set_theme($theme) {
self::$current_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 self::$current_theme;
} }
/**
* @return string
*/
static function current_custom_theme(){
return self::$current_custom_theme;
}
/** /**
* Pass the SilverStripe template to be used. * Pass the SilverStripe template to be used.
* *
@ -896,4 +911,4 @@ function supressOutput() {
return ""; return "";
} }
?> ?>