Revision 8bf923b2
Von Sven Schöling vor mehr als 3 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
550 | 550 |
} |
551 | 551 |
$language = "de" unless ($language); |
552 | 552 |
|
553 |
if (-f "templates/webpages/${file}.html") { |
|
554 |
$file = "templates/webpages/${file}.html"; |
|
553 |
my $webpages_path = $::request->layout->webpages_path; |
|
554 |
|
|
555 |
if (-f "${webpages_path}/${file}.html") { |
|
556 |
$file = "${webpages_path}/${file}.html"; |
|
555 | 557 |
|
556 | 558 |
} elsif (ref $file eq 'SCALAR') { |
557 | 559 |
# file is a scalarref, use inline mode |
SL/Layout/Base.pm | ||
---|---|---|
38 | 38 |
{} |
39 | 39 |
} |
40 | 40 |
|
41 |
sub webpages_path { |
|
42 |
"templates/webpages"; |
|
43 |
} |
|
44 |
|
|
41 | 45 |
sub get { |
42 | 46 |
$_[0]->sub_layouts; |
43 | 47 |
return grep { $_ } ($_[0]->sub_layouts_by_name->{$_[1]}); |
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