X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fmenu.pl;h=a8b46973ac8d8e4e032fbb3637d544f57ee3fc87;hb=b3bde077a6df1550915b1433b2cabb4cf74ab681;hp=85efc5c370af07d8616cd4ff20757fa1523e395c;hpb=d0810c4289d895acfb8cf477125c6796c51945e3;p=kivitendo-erp.git diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl index 85efc5c37..a8b46973a 100644 --- a/bin/mozilla/menu.pl +++ b/bin/mozilla/menu.pl @@ -38,6 +38,7 @@ $menufile = "menu.ini"; use SL::Menu; use Data::Dumper; +use URI; 1; @@ -48,14 +49,18 @@ $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| - + - - + + You need a browser that can read frames to see this page. @@ -70,11 +75,8 @@ sub display { sub acc_menu { $lxdebug->enter_sub(); $mainlevel = $form->{level}; - $mainlevel =~ s/$mainlevel--//g; + $mainlevel =~ s/\Q$mainlevel\E--//g; my $menu = new Menu "$menufile"; - $menu = new Menu "custom_$menufile" if (-f "custom_$menufile"); - $menu = new Menu "$form->{login}_$menufile" - if (-f "$form->{login}_$menufile"); $form->{title} = $locale->text('Accounting Menu'); @@ -109,7 +111,7 @@ sub section_menu { $item = shift @menuorder; $label = $item; $ml = $item; - $label =~ s/$level--//g; + $label =~ s/\Q$level\E--//g; $ml =~ s/--.*//; if ($ml eq $mainlevel) { $zeige = 1; } else { $zeige = 0; } @@ -118,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 = (); @@ -128,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; @@ -141,7 +144,7 @@ sub section_menu { if ($menu->{$item}{submenu}) { $menu->{$item}{$item} = !$form->{$item}; - if ($form->{level} && $item =~ /^$form->{level}/) { + if ($form->{level} && $item =~ /^\Q$form->{level}\E/) { # expand menu if ($zeige) { @@ -201,7 +204,7 @@ sub section_menu { } else { my $ml_ = $form->escape($ml); print - qq|<tr><td class="bg" height="22" align="left" valign="middle" ><img src="image/$item.png" style="vertical-align:middle">&nbsp;<a href="menu.pl?path=bin/mozilla&action=acc_menu&level=$ml_&login=$form->{login}&password=$form->{password}" class="nohover">$label</a>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n|; + qq|<tr><td class="bg" height="22" align="left" valign="middle" ><img src="image/$item.png" style="vertical-align:middle">&nbsp;<a href="menu.pl?action=acc_menu&level=$ml_" class="nohover">$label</a>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n|; &section_menu($menu, $item); #print qq|<br>\n|;