my %params = @_;
my $package = "SL::Template::" . $params{type};
- $package->new($params{file_name}, $params{form}, $params{myconfig} || \%::myconfig, $params{userspath} || $::lx_office_conf{paths}->{userspath});
+ $package->new(
+ %params,
+ source => $params{file_name},
+ form => $params{form},
+ myconfig => $params{myconfig} || \%::myconfig,
+ userspath => $params{userspath} || $::lx_office_conf{paths}->{userspath},
+ );
}
sub available_templates {
}
sub _init {
- my $self = shift;
+ my ($self, %params) = @_;
- $self->{source} = shift;
- $self->{form} = shift;
- $self->{myconfig} = shift;
- $self->{userspath} = shift;
+ $self->{$_} = $params{$_} for keys %params;
$self->{error} = undef;
$self->{quot_re} = '"';