Committer: ailyin
LJSUP-12287 (Need to add name of the layout to the title of the page with source of the layer)U trunk/S2/BackendHTML.pm U trunk/S2/Compiler.pm U trunk/S2/NodeStmtBlock.pm
Modified: trunk/S2/BackendHTML.pm =================================================================== --- trunk/S2/BackendHTML.pm 2010-03-31 09:33:50 UTC (rev 203) +++ trunk/S2/BackendHTML.pm 2012-05-23 11:01:29 UTC (rev 204) @@ -20,9 +20,10 @@ $IntegerColor = "#000000"; sub new { - my ($class, $l) = @_; + my ( $class, $l, $opts ) = @_; my $this = { 'layer' => $l, + 'opts' => $opts || {}, }; bless $this, $class; } @@ -30,7 +31,9 @@ sub output { my ($this, $o) = @_; - $o->write("<html><head><title>Layer Source</title>\n"); + my $html_title = $this->{'opts'}->{'html_title'} || 'Layer Source'; + + $o->write("<html><head><title>$html_title</title>\n"); $o->write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n"); $o->write("<style type=\"text/css\">\n"); $o->write("body { background: #ffffff none; color: #000000; }\n"); Modified: trunk/S2/Compiler.pm =================================================================== --- trunk/S2/Compiler.pm 2010-03-31 09:33:50 UTC (rev 203) +++ trunk/S2/Compiler.pm 2012-05-23 11:01:29 UTC (rev 204) @@ -29,7 +29,8 @@ my $be; $opts->{'format'} ||= "perl"; if ($opts->{'format'} eq "html") { - $be = new S2::BackendHTML($s2l); + $be = S2::BackendHTML->new( $s2l, + { 'html_title' => $opts->{'html_title'} || undef } ); } elsif ($opts->{'format'} eq "perl") { $this->{'checker'}->checkLayer($s2l); $be = new S2::BackendPerl($s2l, $opts->{'layerid'}, $opts->{'untrusted'}); Modified: trunk/S2/NodeStmtBlock.pm =================================================================== --- trunk/S2/NodeStmtBlock.pm 2010-03-31 09:33:50 UTC (rev 203) +++ trunk/S2/NodeStmtBlock.pm 2012-05-23 11:01:29 UTC (rev 204) @@ -146,4 +146,4 @@ } } - +1