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