line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Amon2::Plugin::Web::FillInForm; |
2
|
1
|
|
|
1
|
|
15101
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
20
|
use 5.008001; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
522
|
use HTML::FillInForm; |
|
1
|
|
|
|
|
3306
|
|
|
1
|
|
|
|
|
66
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
0
|
|
|
0
|
0
|
|
my ($class, $c, $conf) = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
10
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
246
|
|
13
|
|
|
|
|
|
|
|
14
|
0
|
|
0
|
|
|
|
my $klass = ref $c || $c; |
15
|
0
|
|
|
|
|
|
*{"$klass\::fillin_form"} = \&_fillin_form2; |
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $response_class = ref $c->create_response(); |
18
|
0
|
|
|
|
|
|
*{"$response_class\::fillin_form"} = \&_fillin_form; |
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _fillin_form2 { |
22
|
0
|
|
|
0
|
|
|
my ($self, @stuff) = @_; |
23
|
|
|
|
|
|
|
$self->add_trigger( |
24
|
|
|
|
|
|
|
'HTML_FILTER' => sub { |
25
|
0
|
|
|
0
|
|
|
my ($c, $html) = @_; |
26
|
0
|
|
|
|
|
|
return HTML::FillInForm->fill(\$html, @stuff); |
27
|
|
|
|
|
|
|
}, |
28
|
0
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# DEPRECATED interface |
32
|
|
|
|
|
|
|
sub _fillin_form { |
33
|
0
|
|
|
0
|
|
|
my ($self, @stuff) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
Carp::cluck("\$res->fillin_form() was deprecated. Use \$c->fillin_form(\$stuff) instead."); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $html = $self->body(); |
38
|
0
|
|
|
|
|
|
my $output = HTML::FillInForm->fill(\$html, @stuff); |
39
|
0
|
|
|
|
|
|
$self->body($output); |
40
|
0
|
0
|
|
|
|
|
$self->header('Content-Length' => length($output)) if $self->header('Content-Length'); |
41
|
0
|
|
|
|
|
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
__END__ |