X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/83cc6a5b947fae258c943b16cfdbdad72f4c690a..cdfebb5085afaf1fe0f0278ca6172d5fe009bd9c:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index 0445a2546..f43578bb6 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -39,7 +39,6 @@ package Form; use Data::Dumper; use Cwd; -use HTML::Template; use Template; use SL::Template; use CGI::Ajax; @@ -556,42 +555,12 @@ sub parse_html_template { $file = $self->_prepare_html_template($file, $additional_params); - my $template = HTML::Template->new("filename" => $file, - "die_on_bad_params" => 0, - "strict" => 0, - "case_sensitive" => 1, - "loop_context_vars" => 1, - "global_vars" => 1); - - foreach my $key ($template->param()) { - my $param = $additional_params->{$key} || $self->{$key}; - $param = [] if (($template->query("name" => $key) eq "LOOP") && (ref($param) ne "ARRAY")); - $template->param($key => $param); - } - - my $output = $template->output(); - - $output = $main::locale->{iconv}->convert($output) if ($main::locale); - - $main::lxdebug->leave_sub(); - - return $output; -} - -sub parse_html_template2 { - $main::lxdebug->enter_sub(); - - my ($self, $file, $additional_params) = @_; - - $additional_params ||= { }; - - $file = $self->_prepare_html_template($file, $additional_params); - - my $template = Template->new({ 'INTERPOLATE' => 0, - 'EVAL_PERL' => 0, - 'ABSOLUTE' => 1, - 'CACHE_SIZE' => 0, - 'PLUGIN_BASE' => 'SL::Template::Plugin', + my $template = Template->new({ 'INTERPOLATE' => 0, + 'EVAL_PERL' => 0, + 'ABSOLUTE' => 1, + 'CACHE_SIZE' => 0, + 'PLUGIN_BASE' => 'SL::Template::Plugin', + 'INCLUDE_PATH' => '.:templates/webpages', }) || die; map { $additional_params->{$_} ||= $self->{$_} } keys %{ $self }; @@ -630,7 +599,7 @@ sub show_generic_error { $self->{title} = $title if ($title); $self->header(); - print $self->parse_html_template2("generic/error", $add_params); + print $self->parse_html_template("generic/error", $add_params); die("Error: $error\n"); } @@ -646,7 +615,7 @@ sub show_generic_information { $self->{title} = $title if ($title); $self->header(); - print $self->parse_html_template2("generic/information", $add_params); + print $self->parse_html_template("generic/information", $add_params); die("Information: $error\n"); }