line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package meon::Web::View::XSLT; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
7433148
|
use strict; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
183
|
|
4
|
2
|
|
|
2
|
|
24
|
use base 'Catalyst::View::XSLT'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1980
|
|
5
|
|
|
|
|
|
|
use Encode 'decode'; |
6
|
|
|
|
|
|
|
use Path::Class 'file'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# configured in meon_web.pl |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub render { |
11
|
|
|
|
|
|
|
my ($self, $c, @args) = @_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
unless ($c->stash->{xml}) { |
14
|
|
|
|
|
|
|
$c->stash->{xml} = $c->model('ResponseXML')->as_xml; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $content = $self->SUPER::render($c, @args); |
18
|
|
|
|
|
|
|
$content =~ s{<br></br>}{<br>}g; # otherwise browser interprets it as 2x <br> |
19
|
|
|
|
|
|
|
return decode('UTF-8', $content); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub process { |
23
|
|
|
|
|
|
|
my ($self, $c, @args) = @_; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
if ($c->debug && $c->req->param('debug_xml')) { |
26
|
|
|
|
|
|
|
$c->res->content_type('text/xml'); |
27
|
|
|
|
|
|
|
$c->stash->{template} = file( |
28
|
|
|
|
|
|
|
meon::Web::SPc->datadir, |
29
|
|
|
|
|
|
|
'meon-web', 'template', 'xsl', |
30
|
|
|
|
|
|
|
'debug.xsl' |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return $self->SUPER::process($c, @args); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |