Änderungen für den SEPA-Export
[kivitendo-erp.git] / bin / mozilla / menu.pl
index 976e27e..a8b4697 100644 (file)
@@ -38,6 +38,7 @@
 $menufile = "menu.ini";
 use SL::Menu;
 use Data::Dumper;
+use URI;
 
 1;
 
@@ -48,6 +49,10 @@ $framesize = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "190";
 sub display {
   $lxdebug->enter_sub();
 
+  my $callback   = $form->unescape($form->{callback});
+  $callback      = URI->new($callback)->rel($callback) if $callback;
+  $callback      = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
+
   $form->header;
 
   print qq|
@@ -55,7 +60,7 @@ sub display {
   <frame  src="kopf.pl" name="kopf"  scrolling="NO">
   <frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" >
     <frame src="$form->{script}?action=acc_menu" name="acc_menu"  scrolling="auto" noresize marginwidth="0">
-    <frame src="login.pl?action=company_logo" name="main_window" scrolling="auto">
+    <frame src="$callback" name="main_window" scrolling="auto">
   </frameset>
   <noframes>
   You need a browser that can read frames to see this page.
@@ -115,9 +120,9 @@ sub section_menu {
     $label_icon = $label . ".gif";
     $mlab       = $label;
     $label      = $locale->text($label);
+
     # multi line hack, sschoeling jul06
-    # if a label is too long, try to split it at whitespaces, then join it to chunks of less 
+    # if a label is too long, try to split it at whitespaces, then join it to chunks of less
     # than 20 chars and store it in an array.
     # use this array later instead of the &nbsp;-ed label
     @chunks = ();
@@ -125,9 +130,10 @@ sub section_menu {
     map {
       if (($l += length $_) < 20) {
         $chunks[$i] .= " $_";
-      } else { 
-        $l = length $_; 
-        $chunks[++$i] = $_; 
+      } else {
+        $l = length $_;
+        $chunks[++$i] = $_;
+
       }
     } split / /, $label;
     map { s/ /&nbsp;/ } @chunks;