line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Template::Extension::DOC; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = "0.24"; |
4
|
0
|
|
|
0
|
0
|
0
|
sub Version { $VERSION; } |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
89
|
|
7
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
286
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %fields_parent = |
10
|
|
|
|
|
|
|
( |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $re_var = q{ |
14
|
|
|
|
|
|
|
<\s* # first < |
15
|
|
|
|
|
|
|
[Tt][Mm][Pp][Ll]_[Dd][Oo][Cc] # interesting TMPL_DOC tag only |
16
|
|
|
|
|
|
|
\s*> # this is H:T standard tag |
17
|
|
|
|
|
|
|
((?:.*?) # delete alla after here |
18
|
|
|
|
|
|
|
<\s*\/[Tt][Mm][Pp][Ll]_[Dd][Oo][Cc]\s*>)}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub init { |
21
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
22
|
1
|
|
|
|
|
8
|
while (my ($key,$val) = each(%fields_parent)) { |
23
|
0
|
|
0
|
|
|
0
|
$self->{$key} = $self->{$key} || $val; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub push_filter { |
28
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
29
|
1
|
|
|
|
|
1
|
push @{$self->{filter_internal}},@{_get_filter($self)}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _get_filter { |
33
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
34
|
1
|
|
|
|
|
1
|
my @ret ; |
35
|
1
|
|
|
|
|
3
|
push @ret,\&_tmpl_doc; |
36
|
1
|
|
|
|
|
5
|
return \@ret; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# funzione filtro per aggiungere il tag |
41
|
|
|
|
|
|
|
# da tenere fintanto che la nostra patch non sia inserita nella |
42
|
|
|
|
|
|
|
# distribuzione standard del modulo |
43
|
|
|
|
|
|
|
sub _tmpl_doc { |
44
|
2
|
|
|
2
|
|
26
|
my $template = shift; |
45
|
|
|
|
|
|
|
# handle the tag |
46
|
2
|
|
|
|
|
76
|
$$template =~s{$re_var}{}xsg |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |