mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@71918 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
649ce069e7
commit
fadb2c50fd
@ -368,14 +368,17 @@ 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, "<html") !== false) {
|
||||
$content = preg_replace('/(<html[^>]*>)/i', "\\1<!-- template $template -->", $content);
|
||||
$content = preg_replace('/(<\/html[^>]*>)/i', "\\1<!-- end template $template -->", $content);
|
||||
} else {
|
||||
$content = "<!-- template $template -->\n" . $content . "\n<!-- end template $template -->";
|
||||
|
||||
// If the template is a xml template, then wrapping nothing.
|
||||
if(stripos($content, "<?xml")===false){
|
||||
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, "<html") !== false) {
|
||||
$content = preg_replace('/(<html[^>]*>)/i', "\\1<!-- template $template -->", $content);
|
||||
$content = preg_replace('/(<\/html[^>]*>)/i', "\\1<!-- end template $template -->", $content);
|
||||
} else {
|
||||
$content = "<!-- template $template -->\n" . $content . "\n<!-- end template $template -->";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user