line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Controller::HTML::FormFu::Action::MultiFormMethod; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
5736
|
use strict; |
|
9
|
|
|
|
|
25
|
|
|
9
|
|
|
|
|
408
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '2.02'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
48
|
use Moose; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
60
|
|
8
|
9
|
|
|
9
|
|
54026
|
use Carp qw( croak ); |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
544
|
|
9
|
9
|
|
|
9
|
|
53
|
use namespace::autoclean; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
72
|
|
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_method_action}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $multi = $controller->_multiform; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
for ( @{ $self->{_attr_params} } ) { |
|
0
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
for my $method (split) { |
33
|
0
|
0
|
|
|
|
|
$c->log->debug($method) if $c->debug; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
0
|
|
|
|
my $args = $controller->$method($c) || {}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
$multi->populate($args); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
$multi->process; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
$c->stash->{ $config->{multiform_stash} } = $multi; |
44
|
0
|
|
|
|
|
|
$c->stash->{ $config->{form_stash} } = $multi->current_form; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$self->next::method(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |