X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fmenu.pl;h=121f8b4a468ff20deb514a96a661fd10dd0ac273;hb=1d027d8883ed6b13cf6c78b95b3493acc1fb715f;hp=c51596dbb02573602c019e2c615dd33ce9596b60;hpb=54e4131e091831e00a861fe2c4f53e344b87ddca;p=kivitendo-erp.git diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl index c51596dbb..121f8b4a4 100644 --- a/bin/mozilla/menu.pl +++ b/bin/mozilla/menu.pl @@ -52,10 +52,10 @@ sub display { print qq| - + - - + + You need a browser that can read frames to see this page. @@ -70,11 +70,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 +106,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; } @@ -124,13 +121,16 @@ sub section_menu { # than 20 chars and store it in an array. # use this array later instead of the &nbsp;-ed label @chunks = (); - my ($i,$l) =(-1, 20); + my ($i,$l) = (-1, 20); map { - $l += length $_; - if ($l < 20) { $chunks[$i] .= " $_"; - } else { $l =length $_; $chunks[++$i] = $_; } + if (($l += length $_) < 20) { + $chunks[$i] .= " $_"; + } else { + $l = length $_; + $chunks[++$i] = $_; + } } split / /, $label; - map { $chunks[$_] =~ s/ /&nbsp;/ } 0..$#chunks; + map { s/ /&nbsp;/ } @chunks; # end multi line $label =~ s/ /&nbsp;/g; @@ -138,7 +138,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) { @@ -198,7 +198,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_&login=$form->{login}&password=$form->{password}" class="nohover">$label</a>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n|; &section_menu($menu, $item); #print qq|<br>\n|;