Revision 8bf923b2
Von Sven Schöling vor mehr als 3 Jahren hinzugefügt
SL/Presenter.pm | ||
---|---|---|
45 | 45 |
# Look for the file given by $template if $template is not a reference. |
46 | 46 |
my $source; |
47 | 47 |
if (!ref $template) { |
48 |
my $webpages_path = $::request->layout->webpages_path; |
|
49 |
|
|
48 | 50 |
my $ext = $options->{type} eq 'text' ? 'txt' : $options->{type}; |
49 |
$source = "templates/webpages/${template}.${ext}";
|
|
51 |
$source = "${webpages_path}/${template}.${ext}";
|
|
50 | 52 |
croak "Template file ${source} not found" unless -f $source; |
51 | 53 |
|
52 | 54 |
} elsif (ref($template) eq 'SCALAR') { |
... | ... | |
96 | 98 |
sub get_template { |
97 | 99 |
my ($self) = @_; |
98 | 100 |
|
101 |
my $webpages_path = $::request->layout->webpages_path; |
|
102 |
|
|
99 | 103 |
# Make locales.pl parse generic/exception.html, too: |
100 | 104 |
# $::form->parse_html_template("generic/exception") |
101 | 105 |
$self->{template} ||= |
... | ... | |
104 | 108 |
ABSOLUTE => 1, |
105 | 109 |
CACHE_SIZE => 0, |
106 | 110 |
PLUGIN_BASE => 'SL::Template::Plugin', |
107 |
INCLUDE_PATH => '.:templates/webpages',
|
|
111 |
INCLUDE_PATH => ".:$webpages_path",
|
|
108 | 112 |
COMPILE_EXT => '.tcc', |
109 | 113 |
COMPILE_DIR => $::lx_office_conf{paths}->{userspath} . '/templates-cache', |
110 |
ERROR => 'templates/webpages/generic/exception.html',
|
|
114 |
ERROR => "${webpages_path}/generic/exception.html",
|
|
111 | 115 |
ENCODING => 'utf8', |
112 | 116 |
}) || croak; |
113 | 117 |
|
Auch abrufbar als: Unified diff
Layout: webpages_path jetzt im Layout