Form::info() auf Templates umgestellt und Auto-Redirect-Target angepasst
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 13 Jun 2013 15:01:52 +0000 (17:01 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 13 Jun 2013 15:01:52 +0000 (17:01 +0200)
SL/Form.pm
templates/webpages/generic/form_info.html [new file with mode: 0644]

index 8a82587..d6cba73 100644 (file)
@@ -315,35 +315,13 @@ sub info {
   my ($self, $msg) = @_;
 
   if ($ENV{HTTP_USER_AGENT}) {
-    $msg =~ s/\n/<br>/g;
-
-    if (!$self->{header}) {
-      $self->header;
-      print qq|<body>|;
-    }
-
-    print qq|
-    <p class="message_ok"><b>$msg</b></p>
-
-    <script type="text/javascript">
-    <!--
-    // If JavaScript is enabled, the whole thing will be reloaded.
-    // The reason is: When one changes his menu setup (HTML / CSS ...)
-    // it now loads the correct code into the browser instead of do nothing.
-    setTimeout("top.frames.location.href='login.pl'",500);
-    //-->
-    </script>
-
-</body>
-    |;
+    $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 (file)
index 0000000..d56e1fc
--- /dev/null
@@ -0,0 +1,13 @@
+[%- USE P -%]
+<div class="message_ok">
+ <b>[% P.simple_format(message) %]</b>
+</div>
+
+<script type="text/javascript">
+<!--
+ // If JavaScript is enabled, the whole thing will be reloaded.
+ // The reason is: When one changes his menu setup (HTML / CSS ...)
+ // it now loads the correct code into the browser instead of do nothing.
+ setTimeout("top.frames.location.href='login.pl?action=company_logo'",500);
+-->
+</script>