line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Template::Nes::Inject by Skriptke |
4
|
|
|
|
|
|
|
# Copyright 2009 - 2010 Enrique F. Castañón Barbero |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Include Nes templates in Template Toolkit. |
7
|
|
|
|
|
|
|
# Requires Nes 1.04 or higher |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Template::Nes::Inject; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
38920
|
use vars qw(@ISA); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
84
|
|
14
|
|
|
|
|
|
|
@ISA = qw( Nes::Template::Top ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.00_1'; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
19
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
31
|
|
20
|
1
|
|
|
1
|
|
4302
|
use Template; |
|
1
|
|
|
|
|
52867
|
|
|
1
|
|
|
|
|
33
|
|
21
|
1
|
|
|
1
|
|
582
|
use Nes::Template; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new { |
24
|
|
|
|
|
|
|
my $class = shift; |
25
|
|
|
|
|
|
|
my $self = $class->SUPER::new( shift ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$self->{'tt'} = Template->new(); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub process { |
33
|
|
|
|
|
|
|
my $self = shift; |
34
|
|
|
|
|
|
|
my $vars = shift; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $out = ''; |
37
|
|
|
|
|
|
|
$self->{'tt'}->process($self->get_out_ref, $vars, \$out ) |
38
|
|
|
|
|
|
|
|| die "Template process failed: ", $self->{'tt'}->error(), "\n"; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$self->run($vars,$out); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
__END__ |