From 995859cb75538e3e67dfac45a948707c76d4ca33 Mon Sep 17 00:00:00 2001 From: Jeremy Dorn Date: Wed, 13 Jun 2012 13:19:12 -0700 Subject: [PATCH] Added syntax highlighting for formatted queries in php reports. --- classes/report_types/PhpReportType.php | 4 ++-- templates/html/report.mustache | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/report_types/PhpReportType.php b/classes/report_types/PhpReportType.php index aefdd257..655c6cfe 100644 --- a/classes/report_types/PhpReportType.php +++ b/classes/report_types/PhpReportType.php @@ -38,10 +38,10 @@ public static function run(&$report) { $parts = preg_split('/<\?php \/\*(BEGIN|END) (INCLUDED REPORT|REPORT MACROS)\*\/ \?>/',$eval); $formatted = ''; - $code = '
'.htmlentities(array_pop($parts)).'
'; + $code = '
'.highlight_string(array_pop($parts),true).'
'; foreach($parts as $part) { if(!trim($part)) continue; - $formatted .= "
".htmlentities($part)."
"; + $formatted .= "
".highlight_string($part, true)."
"; } $formatted .= $code; diff --git a/templates/html/report.mustache b/templates/html/report.mustache index 6859ec22..268989ee 100644 --- a/templates/html/report.mustache +++ b/templates/html/report.mustache @@ -179,7 +179,7 @@ $('.show_query').click(function() { }); $('.included_report').each(function() { var self = $(this); - self.css('display','none').css('background-color','#ddd'); + self.css('display','none').css('background-color','#f4f4f4').css('padding-left','10px'); var link = $('').attr('href','#').text('View Included Report').css('display','block').click(function() { self.toggle(200); return false;