From 86937e158181c9683401c23cf55bf015d55b784a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 13 Jun 2013 17:01:52 +0200 Subject: [PATCH] Form::info() auf Templates umgestellt und Auto-Redirect-Target angepasst --- SL/Form.pm | 32 ++++------------------- templates/webpages/generic/form_info.html | 13 +++++++++ 2 files changed, 18 insertions(+), 27 deletions(-) create mode 100644 templates/webpages/generic/form_info.html diff --git a/SL/Form.pm b/SL/Form.pm index 8a82587e9..d6cba7321 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -315,35 +315,13 @@ sub info { my ($self, $msg) = @_; if ($ENV{HTTP_USER_AGENT}) { - $msg =~ s/\n/
/g; - - if (!$self->{header}) { - $self->header; - print qq||; - } - - print qq| -

$msg

- - - - - |; + $self->header; + print $self->parse_html_template('generic/form_info', { message => $msg }); + } elsif ($self->{info_function}) { + &{ $self->{info_function} }($msg); } else { - - if ($self->{info_function}) { - &{ $self->{info_function} }($msg); - } else { - print "$msg\n"; - } + print "$msg\n"; } $main::lxdebug->leave_sub(); diff --git a/templates/webpages/generic/form_info.html b/templates/webpages/generic/form_info.html new file mode 100644 index 000000000..d56e1fcb0 --- /dev/null +++ b/templates/webpages/generic/form_info.html @@ -0,0 +1,13 @@ +[%- USE P -%] +
+ [% P.simple_format(message) %] +
+ + -- 2.20.1