line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Controller::HTML::FormFu::Action::MultiFormConfig; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
6533
|
use strict; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
441
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '2.02'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
52
|
use Moose; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
63
|
|
8
|
9
|
|
|
9
|
|
55556
|
use Config::Any; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
260
|
|
9
|
9
|
|
|
9
|
|
50
|
use namespace::autoclean; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
81
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends 'Catalyst::Controller::HTML::FormFu::ActionBase::Form'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub execute { |
14
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
my ( $controller, $c ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
if ( $self->reverse =~ $self->_form_action_regex ) { |
18
|
|
|
|
|
|
|
# don't load form again |
19
|
0
|
|
|
|
|
|
return $self->next::method(@_); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $config = $controller->_html_formfu_config; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return $self->next::method(@_) |
25
|
|
|
|
|
|
|
unless exists $self->attributes->{ActionClass} |
26
|
|
|
|
|
|
|
&& $self->attributes->{ActionClass}[0] eq |
27
|
0
|
0
|
0
|
|
|
|
$config->{multiform_config_action}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $multi = $controller->_multiform; |
30
|
0
|
|
0
|
|
|
|
my @files = grep {length} split /\s+/, $self->{_attr_params}->[0] || ''; |
|
0
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
if ( !@files ) { |
33
|
0
|
|
|
|
|
|
push @files, $self->reverse; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $ext_regex = $config->{_file_ext_regex}; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
for my $file (@files) { |
39
|
|
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
$c->log->debug( __PACKAGE__ . " searching for file '$file'" ) |
41
|
|
|
|
|
|
|
if $c->debug; |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
if ( $file =~ m/ \. $ext_regex \z /x ) { |
44
|
0
|
|
|
|
|
|
$multi->load_config_file($file); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
else { |
47
|
0
|
|
|
|
|
|
$multi->load_config_filestem($file); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$multi->process; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
$c->stash->{ $config->{multiform_stash} } = $multi; |
54
|
0
|
|
|
|
|
|
$c->stash->{ $config->{form_stash} } = $multi->current_form; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
$self->next::method(@_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |