line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Rose::HTML::Form::Field::OnOff::Selectable; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
132
|
use strict; |
|
12
|
|
|
|
|
34
|
|
|
12
|
|
|
|
|
399
|
|
4
|
|
|
|
|
|
|
|
5
|
12
|
|
|
12
|
|
65
|
use base 'Rose::HTML::Form::Field::OnOff'; |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
5656
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.606'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->required_html_attr_value |
10
|
|
|
|
|
|
|
( |
11
|
|
|
|
|
|
|
value => '', |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub selected |
15
|
|
|
|
|
|
|
{ |
16
|
4273
|
|
|
4273
|
0
|
6644
|
my($self) = shift; |
17
|
|
|
|
|
|
|
|
18
|
4273
|
100
|
|
|
|
8471
|
if(@_) |
19
|
|
|
|
|
|
|
{ |
20
|
1218
|
|
|
|
|
3410
|
$self->is_cleared(0); |
21
|
1218
|
100
|
|
|
|
6474
|
return $self->{'selected'} = |
|
|
100
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$self->html_attr(selected => $_[0] ? 1 : (defined $_[0] ? 0 : undef)); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
3055
|
100
|
|
|
|
6424
|
return 0 if($self->is_cleared); |
26
|
|
|
|
|
|
|
|
27
|
1634
|
100
|
|
|
|
12634
|
return defined $self->{'selected'} ? $self->{'selected'} : $self->default_value; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
*input_value = \&selected; |
31
|
|
|
|
|
|
|
|
32
|
2464
|
100
|
|
2464
|
0
|
4323
|
sub is_selected { shift->selected ? 1 : 0 } |
33
|
|
|
|
|
|
|
|
34
|
2463
|
|
|
2463
|
0
|
4482
|
sub is_on { shift->is_selected } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub clear |
37
|
|
|
|
|
|
|
{ |
38
|
859
|
|
|
859
|
1
|
1377
|
my($self) = shift; |
39
|
|
|
|
|
|
|
|
40
|
859
|
|
|
|
|
2124
|
$self->selected(0); |
41
|
859
|
|
|
|
|
2765
|
$self->error(undef); |
42
|
859
|
|
|
|
|
1954
|
$self->is_cleared(1); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub reset |
46
|
|
|
|
|
|
|
{ |
47
|
47
|
|
|
47
|
1
|
83
|
my($self) = shift; |
48
|
|
|
|
|
|
|
|
49
|
47
|
|
|
|
|
116
|
$self->selected(undef); |
50
|
47
|
|
|
|
|
157
|
$self->error(undef); |
51
|
47
|
|
|
|
|
126
|
$self->is_cleared(0); |
52
|
47
|
|
|
|
|
212
|
return 1; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub hidden |
56
|
|
|
|
|
|
|
{ |
57
|
614
|
|
|
614
|
0
|
982
|
my($self) = shift; |
58
|
|
|
|
|
|
|
|
59
|
614
|
100
|
|
|
|
1174
|
if(@_) |
60
|
|
|
|
|
|
|
{ |
61
|
31
|
100
|
|
|
|
96
|
if($self->{'_hidden'} = shift(@_) ? 1 : 0) |
|
|
100
|
|
|
|
|
|
62
|
|
|
|
|
|
|
{ |
63
|
15
|
|
|
|
|
33
|
$self->selected(undef); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
614
|
|
|
|
|
1727
|
return $self->{'_hidden'}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |