X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter.pm;h=44332bd91a666971e0ce3057039d62c6af61d7cd;hb=95b5d54bac9dc0cb47c67444c9e19c1d68b0d520;hp=b3191750c3e95eb8891ac7ed85e4a27c45af0569;hpb=0e5e350124f7eec8f67109fe4777bc2dae6c0ea6;p=kivitendo-erp.git diff --git a/SL/Presenter.pm b/SL/Presenter.pm index b3191750c..44332bd91 100644 --- a/SL/Presenter.pm +++ b/SL/Presenter.pm @@ -45,8 +45,10 @@ sub render { # Look for the file given by $template if $template is not a reference. my $source; if (!ref $template) { + my $webpages_path = $::request->layout->webpages_path; + my $ext = $options->{type} eq 'text' ? 'txt' : $options->{type}; - $source = "templates/webpages/${template}.${ext}"; + $source = "${webpages_path}/${template}.${ext}"; croak "Template file ${source} not found" unless -f $source; } elsif (ref($template) eq 'SCALAR') { @@ -96,6 +98,8 @@ sub render { sub get_template { my ($self) = @_; + my $webpages_path = $::request->layout->webpages_path; + # Make locales.pl parse generic/exception.html, too: # $::form->parse_html_template("generic/exception") $self->{template} ||= @@ -104,10 +108,10 @@ sub get_template { ABSOLUTE => 1, CACHE_SIZE => 0, PLUGIN_BASE => 'SL::Template::Plugin', - INCLUDE_PATH => '.:templates/webpages', + INCLUDE_PATH => ".:$webpages_path", COMPILE_EXT => '.tcc', COMPILE_DIR => $::lx_office_conf{paths}->{userspath} . '/templates-cache', - ERROR => 'templates/webpages/generic/exception.html', + ERROR => "${webpages_path}/generic/exception.html", ENCODING => 'utf8', }) || croak;