| 1 | package Catalyst::Controller::HTML::FormFu::Action::MultiFormConfig; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 9 | our $VERSION = '2.04'; # VERSION | |||||||||||||||||||||||||||
| 6 | 9 | our $AUTHORITY = 'cpan:NIGELM'; # AUTHORITY | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 9 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 9 | ▶ | use Config::Any; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 9 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 9 | extends 'Catalyst::Controller::HTML::FormFu::ActionBase::Form'; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 4 | ▶ | sub execute { | ||||||||||||||||||||||||||
|
Subroutine
execute: called CC=9 SCAR=23.3
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 4 | my $self = shift; | |||||||||||||||||||||||||||
| 16 | 4 | my ( $controller, $c ) = @_; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 4 | ▶ | if ( $self->reverse =~ $self->_form_action_regex ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # don't load form again | ||||||||||||||||||||||||||||
| 21 | 1 | return $self->next::method(@_); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 3 | my $config = $controller->_html_formfu_config; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | return $self->next::method(@_) | ||||||||||||||||||||||||||||
| 27 | unless exists $self->attributes->{ActionClass} | ||||||||||||||||||||||||||||
| 28 | 3 | ▶ | && $self->attributes->{ActionClass}[0] eq $config->{multiform_config_action}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_config_action"}
MC/DC0%0/2
exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_config_action"}
exists $self->attributes->{"ActionClass"}
$self->attributes->{"ActionClass"}[0] eq $config->{"multiform_config_action"}
Truth table33%1/3
A and B
A= exists $self->attributes->{"ActionClass"}B= $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_config_action"}
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 3 | my $multi = $controller->_multiform; | |||||||||||||||||||||||||||
| 31 | 0 | ▶ | my @files = grep {length} split /\s+/, $self->{_attr_params}->[0] || ''; | ||||||||||||||||||||||||||
|
Condition50%1/2
$self->{'_attr_params'}[0] || ''
MC/DC0%0/1
$self->{'_attr_params'}[0] || ''
$self->{'_attr_params'}[0]
Truth table50%1/2
A
A= $self->{'_attr_params'}[0]
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 3 | ▶ | if ( !@files ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 3 | push @files, $self->reverse; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 3 | my $ext_regex = $config->{_file_ext_regex}; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 3 | for my $file (@files) { | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 3 | ▶ | $c->log->debug( __PACKAGE__ . " searching for file '$file'" ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | if $c->debug; | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 3 | ▶ | if ( $file =~ m/ \. $ext_regex \z /x ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | 0 | $multi->load_config_file($file); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | else { | ||||||||||||||||||||||||||||
| 48 | 3 | $multi->load_config_filestem($file); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 3 | $multi->process; | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 3 | $c->stash->{ $config->{multiform_stash} } = $multi; | |||||||||||||||||||||||||||
| 55 | 3 | $c->stash->{ $config->{form_stash} } = $multi->current_form; | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 3 | $self->next::method(@_); | |||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 9 | 1; | |||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | __END__ | ||||||||||||||||||||||||||||