| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Rose::HTML::Form::Field::Group::OnOff; |
|
2
|
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
122
|
use strict; |
|
|
13
|
|
|
|
|
27
|
|
|
|
13
|
|
|
|
|
373
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
61
|
use Carp(); |
|
|
13
|
|
|
|
|
24
|
|
|
|
13
|
|
|
|
|
179
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
13
|
|
|
13
|
|
537
|
use Rose::HTML::Util(); |
|
|
13
|
|
|
|
|
21
|
|
|
|
13
|
|
|
|
|
252
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
13
|
|
|
13
|
|
61
|
use base 'Rose::HTML::Form::Field::Group'; |
|
|
13
|
|
|
|
|
24
|
|
|
|
13
|
|
|
|
|
6724
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.606'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $Debug = undef; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub resync_name |
|
16
|
|
|
|
|
|
|
{ |
|
17
|
624
|
|
|
624
|
0
|
1085
|
my($self) = shift; |
|
18
|
|
|
|
|
|
|
|
|
19
|
624
|
|
|
|
|
1763
|
$self->SUPER::resync_name(); |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Resync item names too |
|
22
|
624
|
|
|
|
|
1795
|
my $name = $self->local_name; |
|
23
|
|
|
|
|
|
|
|
|
24
|
624
|
|
|
|
|
1805
|
foreach my $item ($self->items) |
|
25
|
|
|
|
|
|
|
{ |
|
26
|
1139
|
|
|
|
|
3141
|
$item->name($name); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub name |
|
31
|
|
|
|
|
|
|
{ |
|
32
|
3247
|
|
|
3247
|
1
|
9243
|
my($self) = shift; |
|
33
|
|
|
|
|
|
|
|
|
34
|
3247
|
100
|
|
|
|
6245
|
if(@_) |
|
35
|
|
|
|
|
|
|
{ |
|
36
|
52
|
|
|
|
|
283
|
$self->local_name(shift); |
|
37
|
|
|
|
|
|
|
|
|
38
|
52
|
|
|
|
|
186
|
my $name = $self->local_name; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# All items in the group must have the same name |
|
41
|
52
|
|
|
|
|
255
|
foreach my $item ($self->items) |
|
42
|
|
|
|
|
|
|
{ |
|
43
|
0
|
|
|
|
|
0
|
$item->name($name); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
3247
|
|
|
|
|
7286
|
my $name = $self->html_attr('name'); |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# The name HTML attr will be an empty string if it's a required attr, |
|
50
|
|
|
|
|
|
|
# so use length() and not defined() |
|
51
|
13
|
|
|
13
|
|
127
|
no warnings 'uninitialized'; |
|
|
13
|
|
|
|
|
57
|
|
|
|
13
|
|
|
|
|
23200
|
|
|
52
|
3247
|
100
|
|
|
|
7105
|
unless(length $name) |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
744
|
|
|
|
|
2054
|
return $self->html_attr('name', $self->fq_name); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
2503
|
|
|
|
|
6816
|
return $name; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub defaults |
|
61
|
|
|
|
|
|
|
{ |
|
62
|
73
|
|
|
73
|
0
|
652
|
my($self) = shift; |
|
63
|
|
|
|
|
|
|
|
|
64
|
73
|
50
|
|
|
|
272
|
if(@_) |
|
65
|
|
|
|
|
|
|
{ |
|
66
|
73
|
50
|
33
|
|
|
561
|
if(@_ == 1 && ref $_[0] eq 'ARRAY') |
|
|
|
100
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
{ |
|
68
|
0
|
|
|
|
|
0
|
$self->{'defaults'} = { map { $_ => 1 } @{$_[0]} }; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
elsif(defined $_[0]) |
|
71
|
|
|
|
|
|
|
{ |
|
72
|
70
|
|
|
|
|
215
|
$self->{'defaults'} = { map { $_ => 1 } @_ }; |
|
|
70
|
|
|
|
|
440
|
|
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
else |
|
75
|
|
|
|
|
|
|
{ |
|
76
|
3
|
|
|
|
|
17
|
$self->{'defaults'} = { }; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
73
|
|
|
|
|
266
|
$self->init_items; |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
|
|
82
|
73
|
50
|
|
|
|
321
|
return (wantarray) ? sort keys %{$self->{'defaults'}} : [ sort keys %{$self->{'defaults'}} ]; |
|
|
0
|
|
|
|
|
0
|
|
|
|
73
|
|
|
|
|
490
|
|
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
*default = \&defaults; |
|
86
|
|
|
|
|
|
|
*default_value = \&defaults; |
|
87
|
|
|
|
|
|
|
*default_values = \&defaults; |
|
88
|
|
|
|
|
|
|
|
|
89
|
178
|
50
|
|
178
|
0
|
465
|
sub default_values_hash { (wantarray) ? %{$_[0]->{'defaults'}} : $_[0]->{'defaults'} } |
|
|
0
|
|
|
|
|
0
|
|
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub _args_to_items |
|
92
|
|
|
|
|
|
|
{ |
|
93
|
37
|
|
|
37
|
|
113
|
my($self) = shift; |
|
94
|
|
|
|
|
|
|
|
|
95
|
37
|
|
|
|
|
238
|
my $items = $self->SUPER::_args_to_items(@_); |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
# All items in the group must have the same name |
|
98
|
37
|
|
|
|
|
102
|
foreach my $item (@$items) |
|
99
|
|
|
|
|
|
|
{ |
|
100
|
87
|
|
|
|
|
250
|
$item->name($self->local_name); |
|
101
|
|
|
|
|
|
|
#$item->name($self->name); |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
37
|
100
|
|
|
|
231
|
return (wantarray) ? @$items : $items; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub item |
|
108
|
|
|
|
|
|
|
{ |
|
109
|
70
|
|
|
70
|
0
|
589
|
my($self, $value) = @_; |
|
110
|
|
|
|
|
|
|
|
|
111
|
70
|
|
|
|
|
207
|
my $group_class = $self->_item_group_class; |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# Dumb linear search for now |
|
114
|
70
|
|
|
|
|
253
|
foreach my $item ($self->items) |
|
115
|
|
|
|
|
|
|
{ |
|
116
|
168
|
100
|
|
|
|
691
|
if($item->isa($group_class)) |
|
117
|
|
|
|
|
|
|
{ |
|
118
|
6
|
|
|
|
|
21
|
foreach my $subitem ($item->items) |
|
119
|
|
|
|
|
|
|
{ |
|
120
|
12
|
100
|
|
|
|
75
|
return $subitem if($subitem->html_attr('value') eq $value); |
|
121
|
|
|
|
|
|
|
} |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
else |
|
124
|
|
|
|
|
|
|
{ |
|
125
|
162
|
100
|
|
|
|
404
|
return $item if($item->html_attr('value') eq $value); |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
|
|
129
|
4
|
|
|
|
|
27
|
return undef; |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub item_group |
|
133
|
|
|
|
|
|
|
{ |
|
134
|
3
|
|
|
3
|
0
|
11
|
my($self, $label) = @_; |
|
135
|
|
|
|
|
|
|
|
|
136
|
3
|
|
|
|
|
11
|
my $group_class = $self->_item_group_class; |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
# Dumb linear search for now |
|
139
|
3
|
|
|
|
|
19
|
foreach my $item ($self->items) |
|
140
|
|
|
|
|
|
|
{ |
|
141
|
12
|
100
|
66
|
|
|
56
|
return $item if($item->isa($group_class) && $item->label eq $label); |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
0
|
return undef; |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub is_selected |
|
148
|
|
|
|
|
|
|
{ |
|
149
|
19
|
|
|
19
|
0
|
68
|
my($self, $value) = @_; |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
# Dumb linear search for now |
|
152
|
19
|
|
|
|
|
65
|
foreach my $item ($self->items) |
|
153
|
|
|
|
|
|
|
{ |
|
154
|
52
|
100
|
100
|
|
|
135
|
if($item->html_attr('value') eq $value && $item->internal_value) |
|
155
|
|
|
|
|
|
|
{ |
|
156
|
8
|
|
|
|
|
54
|
return 1; |
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
} |
|
159
|
|
|
|
|
|
|
|
|
160
|
11
|
|
|
|
|
60
|
return 0; |
|
161
|
|
|
|
|
|
|
} |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
*is_checked = \&is_selected; |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub is_empty |
|
166
|
|
|
|
|
|
|
{ |
|
167
|
6
|
|
|
6
|
1
|
24
|
my($self) = shift; |
|
168
|
|
|
|
|
|
|
|
|
169
|
6
|
|
|
|
|
28
|
foreach my $item ($self->items) |
|
170
|
|
|
|
|
|
|
{ |
|
171
|
13
|
100
|
|
|
|
66
|
return 0 if($item->is_on); |
|
172
|
|
|
|
|
|
|
} |
|
173
|
|
|
|
|
|
|
|
|
174
|
1
|
|
|
|
|
5
|
return 1; |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub add_values |
|
178
|
|
|
|
|
|
|
{ |
|
179
|
13
|
|
|
13
|
0
|
30
|
my($self) = shift; |
|
180
|
|
|
|
|
|
|
|
|
181
|
13
|
|
|
|
|
38
|
$self->input_value($self->internal_value, @_); |
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
|
|
184
|
8
|
|
|
8
|
0
|
48
|
sub add_value { shift->add_values(@_) } |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub input_value |
|
187
|
|
|
|
|
|
|
{ |
|
188
|
132
|
|
|
132
|
1
|
970
|
my($self) = shift; |
|
189
|
|
|
|
|
|
|
|
|
190
|
132
|
|
|
|
|
232
|
my %values; |
|
191
|
|
|
|
|
|
|
|
|
192
|
132
|
100
|
|
|
|
345
|
if(@_) |
|
193
|
|
|
|
|
|
|
{ |
|
194
|
119
|
|
|
|
|
431
|
$self->clear(); |
|
195
|
119
|
|
|
|
|
971
|
$self->is_cleared(0); |
|
196
|
|
|
|
|
|
|
|
|
197
|
119
|
50
|
66
|
|
|
1084
|
if(@_ == 1 && ref $_[0] eq 'ARRAY') |
|
|
|
100
|
66
|
|
|
|
|
|
198
|
|
|
|
|
|
|
{ |
|
199
|
0
|
|
|
|
|
0
|
%values = map { $_ => 1 } @{$_[0]}; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
200
|
|
|
|
|
|
|
} |
|
201
|
|
|
|
|
|
|
elsif(@_ && defined $_[0]) |
|
202
|
|
|
|
|
|
|
{ |
|
203
|
94
|
|
|
|
|
284
|
%values = map { $_ => 1 } @_; |
|
|
115
|
|
|
|
|
532
|
|
|
204
|
|
|
|
|
|
|
} |
|
205
|
|
|
|
|
|
|
|
|
206
|
119
|
100
|
|
|
|
328
|
unless(%values) |
|
207
|
|
|
|
|
|
|
{ |
|
208
|
25
|
|
|
|
|
123
|
$self->clear(); |
|
209
|
25
|
|
|
|
|
176
|
$self->is_cleared(0); |
|
210
|
|
|
|
|
|
|
} |
|
211
|
|
|
|
|
|
|
else |
|
212
|
|
|
|
|
|
|
{ |
|
213
|
94
|
|
|
|
|
249
|
$self->{'values'} = \%values; |
|
214
|
94
|
|
|
|
|
225
|
$self->init_items; |
|
215
|
|
|
|
|
|
|
} |
|
216
|
|
|
|
|
|
|
|
|
217
|
119
|
100
|
|
|
|
501
|
if(my $parent = $self->parent_field) |
|
218
|
|
|
|
|
|
|
{ |
|
219
|
25
|
100
|
|
|
|
172
|
if($parent->_is_full) |
|
220
|
|
|
|
|
|
|
{ |
|
221
|
15
|
|
|
|
|
61
|
$parent->is_cleared(0); |
|
222
|
|
|
|
|
|
|
} |
|
223
|
|
|
|
|
|
|
|
|
224
|
25
|
100
|
|
|
|
103
|
if($self->auto_invalidate_parent) |
|
225
|
|
|
|
|
|
|
{ |
|
226
|
8
|
|
|
|
|
42
|
$parent->invalidate_value; |
|
227
|
|
|
|
|
|
|
} |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
else |
|
231
|
|
|
|
|
|
|
{ |
|
232
|
13
|
100
|
|
|
|
33
|
if(keys %{$self->{'values'}}) |
|
|
13
|
|
|
|
|
55
|
|
|
233
|
|
|
|
|
|
|
{ |
|
234
|
12
|
|
|
|
|
40
|
my $group_class = $self->_item_group_class; |
|
235
|
|
|
|
|
|
|
|
|
236
|
12
|
|
|
|
|
56
|
foreach my $item ($self->items) |
|
237
|
|
|
|
|
|
|
{ |
|
238
|
56
|
100
|
|
|
|
185
|
if($item->isa($group_class)) |
|
239
|
|
|
|
|
|
|
{ |
|
240
|
4
|
|
|
|
|
11
|
foreach my $value ($item->internal_value) |
|
241
|
|
|
|
|
|
|
{ |
|
242
|
4
|
|
|
|
|
15
|
$values{$value} = 1; |
|
243
|
|
|
|
|
|
|
} |
|
244
|
|
|
|
|
|
|
} |
|
245
|
|
|
|
|
|
|
else |
|
246
|
|
|
|
|
|
|
{ |
|
247
|
52
|
100
|
|
|
|
123
|
if($item->is_on) |
|
248
|
|
|
|
|
|
|
{ |
|
249
|
16
|
|
|
|
|
48
|
$values{$item->html_attr('value')} = 1; |
|
250
|
|
|
|
|
|
|
} |
|
251
|
|
|
|
|
|
|
} |
|
252
|
|
|
|
|
|
|
} |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
} |
|
255
|
|
|
|
|
|
|
|
|
256
|
132
|
100
|
|
|
|
886
|
return (wantarray) ? sort keys %values : [ sort keys %values ]; |
|
257
|
|
|
|
|
|
|
} |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
sub value_labels |
|
260
|
|
|
|
|
|
|
{ |
|
261
|
2
|
|
|
2
|
0
|
6
|
my($self) = shift; |
|
262
|
|
|
|
|
|
|
|
|
263
|
2
|
|
|
|
|
4
|
my @labels; |
|
264
|
|
|
|
|
|
|
|
|
265
|
2
|
|
|
|
|
11
|
foreach my $value ($self->internal_value) |
|
266
|
|
|
|
|
|
|
{ |
|
267
|
2
|
50
|
|
|
|
9
|
next unless(defined $value); |
|
268
|
2
|
|
|
|
|
17
|
push(@labels, $self->item($value)->label); |
|
269
|
|
|
|
|
|
|
} |
|
270
|
|
|
|
|
|
|
|
|
271
|
2
|
50
|
|
|
|
19
|
return wantarray ? @labels : \@labels; |
|
272
|
|
|
|
|
|
|
} |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
sub value_label |
|
275
|
|
|
|
|
|
|
{ |
|
276
|
5
|
|
|
5
|
0
|
33
|
my($self) = shift; |
|
277
|
|
|
|
|
|
|
|
|
278
|
5
|
100
|
|
|
|
30
|
unless(@_) |
|
279
|
|
|
|
|
|
|
{ |
|
280
|
2
|
|
|
|
|
15
|
return $self->value_labels->[0]; |
|
281
|
|
|
|
|
|
|
} |
|
282
|
|
|
|
|
|
|
|
|
283
|
3
|
|
|
|
|
11
|
my $value = shift; |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
# Dumb linear search for now |
|
286
|
3
|
|
|
|
|
30
|
foreach my $item ($self->items) |
|
287
|
|
|
|
|
|
|
{ |
|
288
|
3
|
50
|
|
|
|
15
|
if($item->html_attr('value') eq $value) |
|
289
|
|
|
|
|
|
|
{ |
|
290
|
3
|
50
|
|
|
|
24
|
return $item-label(@_) if(@_); |
|
291
|
3
|
50
|
|
|
|
24
|
return ($item->label) ? $item->label : $value; |
|
292
|
|
|
|
|
|
|
} |
|
293
|
|
|
|
|
|
|
} |
|
294
|
|
|
|
|
|
|
|
|
295
|
0
|
|
|
|
|
0
|
return undef; |
|
296
|
|
|
|
|
|
|
} |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
#sub value_label { shift->value_labels->[0] } |
|
299
|
|
|
|
|
|
|
|
|
300
|
5
|
|
|
5
|
1
|
26
|
sub value { shift->input_value(@_) } |
|
301
|
8
|
|
|
8
|
0
|
47
|
sub values { shift->input_value(@_) } |
|
302
|
|
|
|
|
|
|
|
|
303
|
0
|
|
|
0
|
0
|
0
|
sub is_on { Carp::croak "Override in subclass!" } |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
sub internal_value |
|
306
|
|
|
|
|
|
|
{ |
|
307
|
758
|
|
|
758
|
1
|
1290
|
my($self) = shift; |
|
308
|
|
|
|
|
|
|
|
|
309
|
758
|
|
|
|
|
1188
|
my @values; |
|
310
|
|
|
|
|
|
|
|
|
311
|
758
|
|
|
|
|
1995
|
my $group_class = $self->_item_group_class; |
|
312
|
|
|
|
|
|
|
|
|
313
|
758
|
|
|
|
|
2126
|
foreach my $item ($self->items) |
|
314
|
|
|
|
|
|
|
{ |
|
315
|
2374
|
100
|
|
|
|
12405
|
if($item->isa($group_class)) |
|
316
|
|
|
|
|
|
|
{ |
|
317
|
6
|
50
|
|
|
|
16
|
push(@values, $item->internal_value) if(defined $item->internal_value); |
|
318
|
|
|
|
|
|
|
} |
|
319
|
|
|
|
|
|
|
else |
|
320
|
|
|
|
|
|
|
{ |
|
321
|
2368
|
100
|
|
|
|
5088
|
push(@values, $item->value) if($item->is_on); |
|
322
|
|
|
|
|
|
|
} |
|
323
|
|
|
|
|
|
|
} |
|
324
|
|
|
|
|
|
|
|
|
325
|
758
|
|
|
|
|
3913
|
@values = sort @values; # Makes tests easier to write... :-/ |
|
326
|
|
|
|
|
|
|
|
|
327
|
758
|
100
|
|
|
|
2435
|
return wantarray ? @values : \@values; |
|
328
|
|
|
|
|
|
|
} |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
*output_value = \&internal_value; |
|
331
|
|
|
|
|
|
|
|
|
332
|
678
|
50
|
|
678
|
0
|
2624
|
sub input_values_hash { (wantarray) ? %{$_[0]->{'values'}} : $_[0]->{'values'} } |
|
|
0
|
|
|
|
|
0
|
|
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
sub has_value |
|
335
|
|
|
|
|
|
|
{ |
|
336
|
19
|
|
|
19
|
0
|
57
|
my($self, $find_value) = @_; |
|
337
|
|
|
|
|
|
|
|
|
338
|
19
|
|
|
|
|
52
|
foreach my $value ($self->output_value) |
|
339
|
|
|
|
|
|
|
{ |
|
340
|
28
|
100
|
|
|
|
104
|
return 1 if($value eq $find_value); |
|
341
|
|
|
|
|
|
|
} |
|
342
|
|
|
|
|
|
|
|
|
343
|
11
|
|
|
|
|
53
|
return 0; |
|
344
|
|
|
|
|
|
|
} |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
sub init_items |
|
347
|
|
|
|
|
|
|
{ |
|
348
|
678
|
|
|
678
|
0
|
1250
|
my($self) = shift; |
|
349
|
|
|
|
|
|
|
|
|
350
|
678
|
|
100
|
|
|
1509
|
my $values = $self->input_values_hash || {}; |
|
351
|
|
|
|
|
|
|
|
|
352
|
678
|
100
|
|
|
|
2161
|
if(%$values) |
|
|
|
100
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
{ |
|
354
|
107
|
|
|
|
|
329
|
my $group_class = $self->_item_group_class; |
|
355
|
|
|
|
|
|
|
|
|
356
|
107
|
|
|
|
|
367
|
foreach my $item ($self->items) |
|
357
|
|
|
|
|
|
|
{ |
|
358
|
401
|
|
|
|
|
959
|
local $item->{'auto_invalidate_parent'} = $self->auto_invalidate_parent; |
|
359
|
|
|
|
|
|
|
|
|
360
|
401
|
100
|
|
|
|
1650
|
if($item->isa($group_class)) |
|
361
|
|
|
|
|
|
|
{ |
|
362
|
4
|
|
|
|
|
17
|
foreach my $subitem ($item->items) |
|
363
|
|
|
|
|
|
|
{ |
|
364
|
8
|
100
|
|
|
|
19
|
if(exists $values->{$subitem->html_attr('value')}) |
|
365
|
|
|
|
|
|
|
{ |
|
366
|
3
|
|
|
|
|
10
|
$subitem->input_value(1); |
|
367
|
|
|
|
|
|
|
} |
|
368
|
|
|
|
|
|
|
else |
|
369
|
|
|
|
|
|
|
{ |
|
370
|
5
|
|
|
|
|
17
|
$subitem->input_value(0); |
|
371
|
|
|
|
|
|
|
} |
|
372
|
|
|
|
|
|
|
} |
|
373
|
|
|
|
|
|
|
} |
|
374
|
|
|
|
|
|
|
else |
|
375
|
|
|
|
|
|
|
{ |
|
376
|
397
|
100
|
|
|
|
917
|
if(exists $values->{$item->html_attr('value')}) |
|
377
|
|
|
|
|
|
|
{ |
|
378
|
126
|
|
|
|
|
364
|
$item->input_value(1); |
|
379
|
|
|
|
|
|
|
} |
|
380
|
|
|
|
|
|
|
else |
|
381
|
|
|
|
|
|
|
{ |
|
382
|
271
|
|
|
|
|
755
|
$item->input_value(0); |
|
383
|
|
|
|
|
|
|
} |
|
384
|
|
|
|
|
|
|
} |
|
385
|
|
|
|
|
|
|
} |
|
386
|
|
|
|
|
|
|
} |
|
387
|
|
|
|
|
|
|
elsif(!$self->is_cleared) |
|
388
|
|
|
|
|
|
|
{ |
|
389
|
178
|
|
|
|
|
1438
|
my $defaults = $self->default_values_hash; |
|
390
|
|
|
|
|
|
|
|
|
391
|
178
|
|
|
|
|
585
|
foreach my $item ($self->items) |
|
392
|
|
|
|
|
|
|
{ |
|
393
|
498
|
|
|
|
|
1427
|
my $value = $item->html_attr('value'); |
|
394
|
|
|
|
|
|
|
|
|
395
|
498
|
100
|
100
|
|
|
1906
|
if(defined $value && exists $defaults->{$value}) |
|
396
|
|
|
|
|
|
|
{ |
|
397
|
81
|
|
|
|
|
323
|
$item->default_value(1); |
|
398
|
|
|
|
|
|
|
} |
|
399
|
|
|
|
|
|
|
else |
|
400
|
|
|
|
|
|
|
{ |
|
401
|
417
|
|
|
|
|
1143
|
$item->default_value(0); |
|
402
|
|
|
|
|
|
|
} |
|
403
|
|
|
|
|
|
|
} |
|
404
|
|
|
|
|
|
|
} |
|
405
|
|
|
|
|
|
|
} |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
1; |