line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
63
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package XHTML::Instrumented::Form::Control; |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use base 'XHTML::Instrumented::Control'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
204
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
10
|
use Carp qw(croak); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1188
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub args |
11
|
|
|
|
|
|
|
{ |
12
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my %hash; |
15
|
0
|
0
|
|
|
|
|
$hash{action} = $self->{self}{action} if $self->{self}{action}; |
16
|
0
|
0
|
|
|
|
|
$hash{method} = $self->{self}{method} if $self->{self}{method}; |
17
|
0
|
0
|
|
|
|
|
if (my $name = $self->{self}{name}) { |
18
|
0
|
|
|
|
|
|
$hash{name} = $name; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
('method', 'post', @_, %hash ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub expand_content |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my @ret = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
for my $hidden ($self->{self}->auto()) { |
31
|
0
|
0
|
0
|
|
|
|
die 'need value for ' . $hidden->name if !$hidden->value && $hidden->required; |
32
|
0
|
0
|
0
|
|
|
|
warn 'need value for ' . $hidden->name unless $hidden->value || $hidden->optional; |
33
|
0
|
0
|
|
|
|
|
next unless $hidden->value; |
34
|
0
|
|
|
|
|
|
unshift(@ret, sprintf(qq(), $hidden->name, $hidden->value)); |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
$self->SUPER::expand_content(@ret); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub is_form |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
1
|
|
1; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub form |
45
|
|
|
|
|
|
|
{ |
46
|
0
|
|
|
0
|
1
|
|
shift->{self}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub get_element |
50
|
|
|
|
|
|
|
{ |
51
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
52
|
0
|
0
|
|
|
|
|
my $name = shift or croak('need a name'); |
53
|
0
|
|
|
|
|
|
my $form = $self->{self}; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my $ret = $form->{elements}{$name}; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
if ($ret) { |
58
|
0
|
0
|
|
|
|
|
if ($ret->is_multi) { |
59
|
0
|
|
|
|
|
|
$ret->{default} = [ $form->element_values($name) ]; |
60
|
|
|
|
|
|
|
} else { |
61
|
0
|
|
|
|
|
|
$ret->{default} = $form->element_value($name); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return $ret; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
__END__ |