/usr/share/perl5/Catalyst/Controller/HTML/FormFu/Action/FormConfig.pm is in libcatalyst-controller-html-formfu-perl 2.02-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | package Catalyst::Controller::HTML::FormFu::Action::FormConfig;
use strict;
our $VERSION = '2.02'; # VERSION
use Moose;
use Config::Any;
use namespace::autoclean;
extends 'Catalyst::Controller::HTML::FormFu::ActionBase::Form';
sub execute {
my $self = shift;
my ( $controller, $c ) = @_;
if ( $self->reverse =~ $self->_form_action_regex ) {
# don't load form again
return $self->next::method(@_);
}
my $config = $controller->_html_formfu_config;
return $self->next::method(@_)
unless exists $self->attributes->{ActionClass}
&& $self->attributes->{ActionClass}[0] eq $config->{config_action};
my $form = $controller->_form;
my @files = grep {length} split /\s+/, $self->{_attr_params}->[0] || '';
if ( !@files ) {
push @files, $self->reverse;
}
my $ext_regex = $config->{_file_ext_regex};
for my $file (@files) {
$c->log->debug( __PACKAGE__ . " loading config file '$file'" )
if $c->debug;
if ( $file =~ m/ \. $ext_regex \z /x ) {
$form->load_config_file($file);
}
else {
$form->load_config_filestem($file);
}
}
$form->process;
$c->stash->{ $config->{form_stash} } = $form;
$self->next::method(@_);
}
1;
|