From 9d8f72a0f92d01e1e25b14788b193cd662cad0d3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Feb 2017 16:44:01 +0100 Subject: [PATCH] Form: Template-Objekt aus Presenter nehmen und nicht selber speichern --- SL/Form.pm | 29 ++--------------------- locale/de/all | 1 - templates/webpages/generic/exception.html | 23 ------------------ 3 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 templates/webpages/generic/exception.html diff --git a/SL/Form.pm b/SL/Form.pm index 33e0fcbc2..600e9b81c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -621,7 +621,7 @@ sub parse_html_template { $additional_params ||= { }; my $real_file = $self->_prepare_html_template($file, $additional_params); - my $template = $self->template || $self->init_template; + my $template = $self->template; map { $additional_params->{$_} ||= $self->{$_} } keys %{ $self }; @@ -633,32 +633,7 @@ sub parse_html_template { return $output; } -sub init_template { - my $self = shift; - - return $self->template if $self->template; - - # Force scripts/locales.pl to pick up the exception handling template. - # parse_html_template('generic/exception') - return $self->template(Template->new({ - 'INTERPOLATE' => 0, - 'EVAL_PERL' => 0, - 'ABSOLUTE' => 1, - 'CACHE_SIZE' => 0, - 'PLUGIN_BASE' => 'SL::Template::Plugin', - 'INCLUDE_PATH' => '.:templates/webpages', - 'COMPILE_EXT' => '.tcc', - 'COMPILE_DIR' => $::lx_office_conf{paths}->{userspath} . '/templates-cache', - 'ERROR' => 'templates/webpages/generic/exception.html', - 'ENCODING' => 'utf8', - })) || die; -} - -sub template { - my $self = shift; - $self->{template_object} = shift if @_; - return $self->{template_object}; -} +sub template { $::request->presenter->get_template } sub show_generic_error { $main::lxdebug->enter_sub(); diff --git a/locale/de/all b/locale/de/all index b7be55279..c0e0d8d3a 100755 --- a/locale/de/all +++ b/locale/de/all @@ -276,7 +276,6 @@ $self->{texts} = { 'Amounts differ too much' => 'Beträge weichen zu sehr voneinander ab.', 'An error occured. Letter could not be deleted.' => 'Es ist ein Fehler aufgetreten. Der Brief konnte nicht gelöscht werden.', 'An error occurred while transferring the file.' => 'Bei Übertragung der Datei trat ein Fehler auf', - 'An exception occurred during execution.' => 'Während der Ausführung trat eine Ausnahme auf.', 'An invalid character was used (invalid characters: #1).' => 'Ein ungültiges Zeichen wurde benutzt (ungültige Zeichen: #1).', 'An invalid character was used (valid characters: #1).' => 'Ein ungültiges Zeichen wurde benutzt (gültige Zeichen: #1).', 'An upper-case character is required.' => 'Ein Großbuchstabe ist vorgeschrieben.', diff --git a/templates/webpages/generic/exception.html b/templates/webpages/generic/exception.html deleted file mode 100644 index 8b70d41a0..000000000 --- a/templates/webpages/generic/exception.html +++ /dev/null @@ -1,23 +0,0 @@ -[%- USE LxERP %] -[%- USE HTML %] - -

[%- LxERP.t8('Error!') %]

- -

- [%- LxERP.t8('An exception occurred during execution.') %] -

- -
- - - - - - - - - - -
[%- LxERP.t8('Type') %]:[%- HTML.escape(error.type) %]
[%- LxERP.t8('Information') %]:
[%- HTML.escape(error.info) %]
-
- -- 2.20.1