Skip to content

Commit

Permalink
Added syntax highlighting for formatted queries in php reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorn committed Jun 13, 2012
1 parent 100bdf1 commit 995859c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions classes/report_types/PhpReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public static function run(&$report) {

$parts = preg_split('/<\?php \/\*(BEGIN|END) (INCLUDED REPORT|REPORT MACROS)\*\/ \?>/',$eval);
$formatted = '';
$code = '<div style="margin: 10px 0;">'.htmlentities(array_pop($parts)).'</div>';
$code = '<div style="margin: 10px 0;">'.highlight_string(array_pop($parts),true).'</div>';
foreach($parts as $part) {
if(!trim($part)) continue;
$formatted .= "<div class='included_report'>".htmlentities($part)."</div>";
$formatted .= "<div class='included_report'>".highlight_string($part, true)."</div>";
}
$formatted .= $code;

Expand Down
2 changes: 1 addition & 1 deletion templates/html/report.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<a>').attr('href','#').text('View Included Report').css('display','block').click(function() {
self.toggle(200);
return false;
Expand Down

0 comments on commit 995859c

Please sign in to comment.