line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormFu::Role::Filter::Compound; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
3935
|
use strict; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
307
|
|
4
|
|
|
|
|
|
|
our $VERSION = '2.05'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
32
|
use Moose::Role; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
54
|
|
7
|
8
|
|
|
8
|
|
26800
|
use MooseX::Attribute::FormFuChained; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
1528
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has field_order => ( is => 'rw', traits => ['FormFuChained'] ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub _get_values { |
12
|
7
|
|
|
7
|
|
16
|
my ( $self, $value ) = @_; |
13
|
|
|
|
|
|
|
|
14
|
7
|
|
|
|
|
10
|
my ( $multi, @fields ) = @{ $self->parent->get_fields }; |
|
7
|
|
|
|
|
28
|
|
15
|
|
|
|
|
|
|
|
16
|
7
|
100
|
|
|
|
206
|
if ( my $order = $self->field_order ) { |
17
|
2
|
|
|
|
|
3
|
my @new_order; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
FIELD: |
20
|
2
|
|
|
|
|
6
|
for my $i (@$order) { |
21
|
5
|
|
|
|
|
5
|
for my $field (@fields) { |
22
|
9
|
100
|
|
|
|
19
|
if ( $field->name eq $i ) { |
23
|
5
|
|
|
|
|
7
|
push @new_order, $field; |
24
|
5
|
|
|
|
|
9
|
next FIELD; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
5
|
@fields = @new_order; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
7
|
|
|
|
|
17
|
my @names = map { $_->name } @fields; |
|
17
|
|
|
|
|
40
|
|
33
|
|
|
|
|
|
|
|
34
|
7
|
50
|
|
|
|
16
|
return map { defined $_ ? $_ : '' } @{$value}{@names}; |
|
17
|
|
|
|
|
50
|
|
|
7
|
|
|
|
|
18
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
HTML::FormFu::Role::Filter::Compound - Role for Compound filters |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
version 2.05 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 METHODS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 field_order |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Arguments: \@order |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
If the submitted parts should be joined in an order different than that of the |
56
|
|
|
|
|
|
|
order of the fields, you must provide an arrayref containing the names, in the |
57
|
|
|
|
|
|
|
order they should be joined. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
--- |
60
|
|
|
|
|
|
|
element: |
61
|
|
|
|
|
|
|
- type: Multi |
62
|
|
|
|
|
|
|
name: address |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
elements: |
65
|
|
|
|
|
|
|
- name: street |
66
|
|
|
|
|
|
|
- name: number |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
filter: |
69
|
|
|
|
|
|
|
- type: CompoundJoin |
70
|
|
|
|
|
|
|
field_order: |
71
|
|
|
|
|
|
|
- number |
72
|
|
|
|
|
|
|
- street |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHOR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Carl Franks, C<cfranks@cpan.org> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 LICENSE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
81
|
|
|
|
|
|
|
the same terms as Perl itself. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |