line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
11
|
|
|
11
|
|
68
|
|
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
258
|
|
4
|
|
|
|
|
|
|
use Carp(); |
5
|
11
|
|
|
11
|
|
47
|
|
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
156
|
|
6
|
|
|
|
|
|
|
use base 'Rose::HTML::Form::Field::Group::OnOff'; |
7
|
11
|
|
|
11
|
|
41
|
|
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
3962
|
|
8
|
|
|
|
|
|
|
use Rose::HTML::Form::Field::Group; |
9
|
11
|
|
|
11
|
|
73
|
|
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
81
|
|
10
|
|
|
|
|
|
|
require Rose::HTML::Form::Field::Option; |
11
|
|
|
|
|
|
|
require Rose::HTML::Form::Field::OptionGroup; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.606'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
62
|
|
|
62
|
|
252
|
*options = \&Rose::HTML::Form::Field::Group::items; |
17
|
912
|
|
|
912
|
|
2125
|
*options_localized = \&Rose::HTML::Form::Field::Group::items_localized; |
18
|
0
|
|
|
0
|
|
0
|
*option = \&Rose::HTML::Form::Field::Group::OnOff::item; |
19
|
0
|
|
|
0
|
|
0
|
*option_group = \&Rose::HTML::Form::Field::Group::OnOff::item_group; |
20
|
|
|
|
|
|
|
*visible_options = \&Rose::HTML::Form::Field::Group::visible_items; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
*add_options = \&Rose::HTML::Form::Field::Group::add_items; |
23
|
|
|
|
|
|
|
*add_option = \&add_options; |
24
|
|
|
|
|
|
|
*add_options_localized = \&Rose::HTML::Form::Field::Group::add_items_localized; |
25
|
|
|
|
|
|
|
*add_option_localized = \&add_options_localized; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
*add_options_localized = \&Rose::HTML::Form::Field::Group::add_items_localized; |
28
|
|
|
|
|
|
|
*add_option_localized = \&Rose::HTML::Form::Field::Group::add_item_localized; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
*choices = \&options; |
31
|
|
|
|
|
|
|
*choices_localized = \&options_localized; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
*_args_to_items = \&Rose::HTML::Form::Field::Group::_args_to_items; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
*show_all_options = \&Rose::HTML::Form::Field::Group::show_all_items; |
36
|
|
|
|
|
|
|
*hide_all_options = \&Rose::HTML::Form::Field::Group::hide_all_items; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
*delete_option = \&Rose::HTML::Form::Field::Group::delete_item; |
39
|
|
|
|
|
|
|
*delete_options = \&Rose::HTML::Form::Field::Group::delete_items; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
*delete_option_group = \&Rose::HTML::Form::Field::Group::delete_item_group; |
42
|
|
|
|
|
|
|
*delete_option_groups = \&Rose::HTML::Form::Field::Group::delete_item_groups; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#sub name { shift->html_attr('name', @_) } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
0
|
1
|
0
|
no warnings 'uninitialized'; |
50
|
0
|
|
|
0
|
1
|
0
|
return (grep { /\S/ } shift->internal_value) ? 0 : 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
0
|
0
|
0
|
my($self) = shift; |
55
|
|
|
|
|
|
|
Carp::croak "Cannot set children() for an option container ($_[0]). Use options() instead." if(@_); |
56
|
|
|
|
|
|
|
return $self->options; |
57
|
|
|
|
|
|
|
} |
58
|
11
|
|
|
11
|
|
85
|
|
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
3604
|
|
59
|
503
|
100
|
|
503
|
1
|
1137
|
|
|
503
|
|
|
|
|
2088
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
{ |
64
|
12
|
|
|
12
|
1
|
1846
|
my($self, $index) = @_; |
65
|
12
|
50
|
|
|
|
32
|
my $items = $self->items || []; |
66
|
12
|
|
|
|
|
37
|
return $items->[$index]; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
0
|
1
|
0
|
{ |
70
|
0
|
|
|
0
|
1
|
0
|
my($self) = shift; |
71
|
|
|
|
|
|
|
Carp::croak "Missing array index" unless(@_); |
72
|
0
|
|
|
0
|
1
|
0
|
my $items = $self->items || []; |
73
|
0
|
|
|
0
|
1
|
0
|
no warnings; |
74
|
|
|
|
|
|
|
splice(@$items, $_[0], 1); |
75
|
0
|
|
|
0
|
1
|
0
|
} |
76
|
0
|
|
|
0
|
1
|
0
|
|
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
0
|
1
|
0
|
my($self) = shift; |
79
|
0
|
|
|
0
|
1
|
0
|
|
80
|
|
|
|
|
|
|
my $html; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
if($self->apply_error_class && defined $self->error) |
83
|
0
|
|
|
0
|
1
|
0
|
{ |
84
|
0
|
|
0
|
|
|
0
|
my $class = $self->html_attr('class'); |
85
|
0
|
|
|
|
|
0
|
$self->html_attr(class => $class ? "$class error" : 'error'); |
86
|
|
|
|
|
|
|
$html = $self->start_html . "\n" . |
87
|
|
|
|
|
|
|
join("\n", map { $_->html_field } $self->visible_items) . "\n" . |
88
|
|
|
|
|
|
|
$self->end_html; |
89
|
|
|
|
|
|
|
$self->html_attr(class => $class); |
90
|
0
|
|
|
0
|
0
|
0
|
return $html; |
91
|
0
|
0
|
|
|
|
0
|
} |
92
|
0
|
|
0
|
|
|
0
|
else |
93
|
11
|
|
|
11
|
|
86
|
{ |
|
11
|
|
|
|
|
27
|
|
|
11
|
|
|
|
|
7543
|
|
94
|
0
|
|
|
|
|
0
|
return $self->start_html . "\n" . |
95
|
|
|
|
|
|
|
join("\n", map { $_->html_field } $self->visible_items) . "\n" . |
96
|
|
|
|
|
|
|
$self->end_html; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
} |
99
|
105
|
|
|
105
|
1
|
191
|
|
100
|
|
|
|
|
|
|
{ |
101
|
105
|
|
|
|
|
160
|
my($self) = shift; |
102
|
|
|
|
|
|
|
|
103
|
105
|
100
|
100
|
|
|
279
|
my $xhtml; |
104
|
|
|
|
|
|
|
|
105
|
2
|
|
|
|
|
9
|
if($self->apply_error_class && defined $self->error) |
106
|
2
|
50
|
|
|
|
11
|
{ |
107
|
|
|
|
|
|
|
my $class = $self->html_attr('class'); |
108
|
2
|
|
|
|
|
16
|
$self->html_attr(class => $class ? "$class error" : 'error'); |
|
6
|
|
|
|
|
15
|
|
109
|
|
|
|
|
|
|
$xhtml = $self->start_xhtml . "\n" . |
110
|
2
|
|
|
|
|
10
|
join("\n", map { $_->xhtml_field } $self->visible_items) . "\n" . |
111
|
2
|
|
|
|
|
6
|
$self->end_xhtml; |
112
|
|
|
|
|
|
|
$self->html_attr(class => $class); |
113
|
|
|
|
|
|
|
return $xhtml; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
else |
116
|
103
|
|
|
|
|
435
|
{ |
|
443
|
|
|
|
|
975
|
|
117
|
|
|
|
|
|
|
return $self->start_xhtml . "\n" . |
118
|
|
|
|
|
|
|
join("\n", map { $_->xhtml_field } $self->visible_items) . "\n" . |
119
|
|
|
|
|
|
|
$self->end_xhtml; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
43
|
|
|
43
|
1
|
90
|
# sub html_field |
124
|
|
|
|
|
|
|
# { |
125
|
43
|
|
|
|
|
57
|
# my($self) = shift; |
126
|
|
|
|
|
|
|
# $self->contents("\n" . join("\n", map { $_->html_field } $self->visible_options) . "\n"); |
127
|
43
|
100
|
100
|
|
|
122
|
# return $self->_html_tag(@_); |
128
|
|
|
|
|
|
|
# } |
129
|
2
|
|
|
|
|
8
|
# |
130
|
2
|
50
|
|
|
|
11
|
# sub xhtml_field |
131
|
|
|
|
|
|
|
# { |
132
|
2
|
|
|
|
|
11
|
# my($self) = shift; |
|
6
|
|
|
|
|
17
|
|
133
|
|
|
|
|
|
|
# $self->contents("\n" . join("\n", map { $_->xhtml_field } $self->visible_options) . "\n"); |
134
|
2
|
|
|
|
|
9
|
# return $self->_xhtml_tag(@_); |
135
|
2
|
|
|
|
|
6
|
# } |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
{ |
138
|
|
|
|
|
|
|
my($self) = shift; |
139
|
|
|
|
|
|
|
|
140
|
41
|
|
|
|
|
202
|
if(@_ && (@_ > 1 || (ref $_[0] eq 'ARRAY' && @{$_[0]} > 1)) && !$self->multiple) |
|
138
|
|
|
|
|
319
|
|
141
|
|
|
|
|
|
|
{ |
142
|
|
|
|
|
|
|
Carp::croak "Attempt to select multiple values in a non-multiple " . ref($self); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
my $values = $self->SUPER::input_value(@_); |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Carp::croak "Non-multiple ", ref($self), " has multiple values: ", join(', ', @$values) |
148
|
|
|
|
|
|
|
if(@$values > 1 && !$self->multiple); |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
return wantarray ? @$values : $values; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
{ |
154
|
|
|
|
|
|
|
my($self) = shift; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
my @hidden; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
foreach my $item ($self->items) |
159
|
|
|
|
|
|
|
{ |
160
|
|
|
|
|
|
|
if(defined $item->internal_value) |
161
|
85
|
|
|
85
|
1
|
174
|
{ |
162
|
|
|
|
|
|
|
# Derek Watson suggests this conditional modifier, but |
163
|
85
|
100
|
100
|
|
|
506
|
# I've yet to see the error is works around... |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
164
|
|
|
|
|
|
|
$hidden[-1]->name($self->name) |
165
|
1
|
|
|
|
|
186
|
if(push(@hidden, $item->hidden_field)); |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
} |
168
|
84
|
|
|
|
|
330
|
|
169
|
|
|
|
|
|
|
return (wantarray) ? @hidden : \@hidden; |
170
|
84
|
50
|
66
|
|
|
288
|
} |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
{ |
173
|
84
|
100
|
|
|
|
356
|
my($self) = shift; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
if(@_) |
176
|
|
|
|
|
|
|
{ |
177
|
|
|
|
|
|
|
if($self->{'_hidden'} = shift(@_) ? 1 : 0) |
178
|
28
|
|
|
28
|
1
|
52
|
{ |
179
|
|
|
|
|
|
|
foreach my $option ($self->options) |
180
|
28
|
|
|
|
|
46
|
{ |
181
|
|
|
|
|
|
|
$option->selected(undef); |
182
|
28
|
|
|
|
|
75
|
} |
183
|
|
|
|
|
|
|
} |
184
|
156
|
100
|
|
|
|
338
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
return $self->{'_hidden'}; |
187
|
|
|
|
|
|
|
} |
188
|
42
|
50
|
|
|
|
144
|
|
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
1; |
191
|
|
|
|
|
|
|
|