use entry::element_of to set action parameter

This commit is contained in:
Milan
2020-03-08 15:09:07 +01:00
parent 5c73484638
commit accc9393c7
19 changed files with 53 additions and 141 deletions

View File

@@ -221,13 +221,7 @@ sub check_params {
$template = template::check( $config, $params->{template}, 'studios' );
$checked->{template} = $template;
#actions
my $action = '';
if ( defined $params->{action} ) {
if ( $params->{action} =~ /^(save|delete)$/ ) {
$checked->{action} = $params->{action};
}
}
$checked->{action} = entry::element_of( $params->{action}, ['save', 'delete']);
entry::set_strings( $checked, $params, [
'name', 'description', 'location', 'stream', 'google_calendar', 'image', 'setImage' ]);