line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
38
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
728
|
|
2
|
5
|
|
|
5
|
|
30
|
use warnings FATAL => 'all'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
557
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package HTML::Tested::Value::Array; |
5
|
5
|
|
|
5
|
|
27
|
use base 'HTML::Tested::Value'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1065
|
|
6
|
5
|
|
|
5
|
|
34
|
use Carp; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
3465
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
14
|
|
|
14
|
1
|
256
|
my $self = shift()->SUPER::new(@_); |
10
|
14
|
|
|
|
|
54
|
my $opts = $self->options; |
11
|
14
|
|
|
|
|
84
|
while (my ($n, $v) = each %$opts) { |
12
|
12
|
100
|
|
|
|
64
|
next unless ref($v) eq 'HASH'; |
13
|
2
|
50
|
|
|
|
17
|
my $dto = $v->{is_datetime} or next; |
14
|
0
|
|
|
|
|
0
|
$self->setup_datetime_option($dto, $v); |
15
|
|
|
|
|
|
|
} |
16
|
14
|
|
|
|
|
44
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub transform_value { |
20
|
44
|
|
|
44
|
0
|
88
|
my ($self, $caller, $val, $n) = @_; |
21
|
44
|
50
|
33
|
|
|
362
|
confess "Invalid non-array value: seal_value" |
22
|
|
|
|
|
|
|
unless $val && ref($val) eq 'ARRAY'; |
23
|
44
|
|
|
|
|
158
|
my $opts = $self->options; |
24
|
44
|
|
|
|
|
67
|
my @res; |
25
|
44
|
|
|
|
|
133
|
for (my $i = 0; $i < @$val; $i++) { |
26
|
103
|
|
|
|
|
204
|
my $nopts = $opts->{$i}; |
27
|
103
|
100
|
|
|
|
476
|
$self->{_options} = $nopts if $nopts; |
28
|
103
|
|
|
|
|
164
|
my $v = $val->[$i]; |
29
|
103
|
|
|
|
|
1975
|
my $dtfs = $caller->ht_get_widget_option($n, "is_datetime"); |
30
|
103
|
50
|
66
|
|
|
553
|
$v = $dtfs->format_datetime($v) if ($v && $dtfs); |
31
|
103
|
100
|
|
|
|
286
|
$v = $self->seal_value($v, $caller) |
32
|
|
|
|
|
|
|
if $caller->ht_get_widget_option($n, "is_sealed"); |
33
|
103
|
50
|
|
|
|
5192
|
$v = $self->encode_value($v, $caller) |
34
|
|
|
|
|
|
|
if !($caller->ht_get_widget_option($n, "is_trusted")); |
35
|
103
|
|
|
|
|
15358
|
push @res, $v; |
36
|
103
|
100
|
|
|
|
451
|
$self->{_options} = $opts if $nopts; |
37
|
|
|
|
|
|
|
} |
38
|
44
|
|
|
|
|
251
|
return \@res; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub seal_value { |
42
|
20
|
|
|
20
|
1
|
50
|
my ($self, $val, $caller) = @_; |
43
|
20
|
50
|
|
|
|
55
|
return $self->options->{isnt_sealed} ? $val |
44
|
|
|
|
|
|
|
: $self->SUPER::seal_value($val, $caller); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |