line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::FillInForm; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
89197
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
80
|
|
4
|
2
|
|
|
2
|
|
10
|
use vars qw($VERSION); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
142
|
|
5
|
|
|
|
|
|
|
$VERSION = 0.04; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Template::Plugin; |
8
|
2
|
|
|
2
|
|
12
|
use base qw(Template::Plugin); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
1771
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
6908
|
use vars qw($FILTER_NAME); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
95
|
|
11
|
|
|
|
|
|
|
$FILTER_NAME = 'fillinform'; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
1841
|
use HTML::FillInForm; |
|
2
|
|
|
|
|
7992
|
|
|
2
|
|
|
|
|
348
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
2
|
|
|
2
|
1
|
5943
|
my($class, $context, @args) = @_; |
17
|
2
|
|
33
|
|
|
13
|
my $name = $args[0] || $FILTER_NAME; |
18
|
2
|
|
|
|
|
8
|
$context->define_filter($name, $class->filter_factory()); |
19
|
2
|
|
|
|
|
70
|
bless {}, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub filter_factory { |
23
|
2
|
|
|
2
|
0
|
4
|
my $class = shift; |
24
|
|
|
|
|
|
|
my $sub = sub { |
25
|
2
|
|
|
2
|
|
127
|
my($context, @args) = @_; |
26
|
2
|
50
|
|
|
|
9
|
my $config = ref $args[-1] eq 'HASH' ? pop(@args) : { }; |
27
|
|
|
|
|
|
|
return sub { |
28
|
2
|
|
|
|
|
41
|
my $text = shift; |
29
|
2
|
|
|
|
|
13
|
my $fif = HTML::FillInForm->new; |
30
|
2
|
|
|
|
|
647089
|
return $fif->fill(scalarref => \$text, %$config); |
31
|
2
|
|
|
|
|
13
|
}; |
32
|
2
|
|
|
|
|
14
|
}; |
33
|
2
|
|
|
|
|
15
|
return [ $sub, 1 ]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |