diff --git a/core/SSViewer.php b/core/SSViewer.php index dfcce7cb8..1dd91e8f6 100644 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -60,14 +60,14 @@ class SSViewer extends Object { * * @param boolean $val */ - function set_source_file_comments($val) { + static function set_source_file_comments($val) { self::$source_file_comments = $val; } /** * @return boolean */ - function get_source_file_comments() { + static function get_source_file_comments() { return self::$source_file_comments; } @@ -368,6 +368,7 @@ class SSViewer extends Object { static function parseTemplateContent($content, $template="") { // Add template filename comments on dev sites + if(Director::isDev() && self::$source_file_comments && $template) { // If this template is a full HTML page, then put the comments just inside the HTML tag to prevent any IE glitches if(stripos($content, "\n" . SSViewer::getTemplateContent($matches[1]) . "\n";'; else $replacementCode = 'return SSViewer::getTemplateContent($matches[1]);';