From 49496e5c4b3e4dfd80479d97877001ec9ad2f661 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Oct 2010 03:40:05 +0000 Subject: [PATCH] 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 --- core/SSViewer.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core/SSViewer.php b/core/SSViewer.php index 0b6de5d3e..359b8294b 100755 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -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 ""; } -?> +?> \ No newline at end of file