line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::ValidOp::Check::checkbox; |
2
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
128
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
112
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
15
|
use base qw/ CGI::ValidOp::Check /; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
965
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub default { |
8
|
|
|
|
|
|
|
( |
9
|
7
|
|
|
7
|
1
|
33
|
qr/^on$/i, |
10
|
|
|
|
|
|
|
q#Checkbox $label must be checked.#, |
11
|
|
|
|
|
|
|
) |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub boolean { |
15
|
23
|
|
|
23
|
1
|
41
|
my $self = shift; |
16
|
|
|
|
|
|
|
sub { |
17
|
23
|
|
|
23
|
|
54
|
my $value = shift; |
18
|
23
|
100
|
|
|
|
121
|
return $self->pass( 0 ) unless defined $value; |
19
|
6
|
100
|
|
|
|
37
|
return $self->pass( 1 ) if $value =~ /^on$/i; |
20
|
2
|
|
|
|
|
11
|
$self->fail( q/Only a checkbox is allowed for parameter $label./ ); |
21
|
|
|
|
|
|
|
} |
22
|
23
|
|
|
|
|
145
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |