line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::Checkbox; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::Checkbox::VERSION = '1.162360'; |
3
|
1
|
|
|
1
|
|
663
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
3
|
use base 'Form::Processor::Field::Boolean'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
362
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
1
|
0
|
sub init_widget { return 'checkbox' } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub input_to_value { |
11
|
3
|
|
|
3
|
1
|
3
|
my $field = shift; |
12
|
|
|
|
|
|
|
|
13
|
3
|
100
|
|
|
|
8
|
return $field->value( $field->input ? 1 : 0 ); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub value { |
17
|
11
|
|
|
11
|
1
|
11
|
my $field = shift; |
18
|
11
|
100
|
|
|
|
30
|
return $field->SUPER::value( @_ ) if @_; |
19
|
4
|
|
|
|
|
9
|
my $v = $field->SUPER::value; |
20
|
4
|
100
|
|
|
|
15
|
return defined $v ? $v : 0; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# ABSTRACT: A boolean checkbox field type |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |