X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fmenunew.pl;h=a1f9a8f2d0169102906a7a4a1696150167fc3879;hb=aeb4f5d5d87753fbdf0d4ec520301ef90354a70a;hp=793cec24eb3c266aca542e02c389df7c9464e2f3;hpb=647be62f8bbcf0e29f6ed29636a5c181e673d27a;p=kivitendo-erp.git diff --git a/bin/mozilla/menunew.pl b/bin/mozilla/menunew.pl index 793cec24e..a1f9a8f2d 100644 --- a/bin/mozilla/menunew.pl +++ b/bin/mozilla/menunew.pl @@ -40,8 +40,6 @@ use SL::Menu; use strict; -my $locale; - 1; # end of main @@ -91,7 +89,6 @@ sub clock_line { sub acc_menu { my $form = $main::form; my %myconfig = %main::myconfig; - $locale = Locale->new($myconfig{countrycode}, "menu"); my $mainlevel = $form->{level}; $mainlevel =~ s/\Q$mainlevel\E--//g; @@ -135,15 +132,29 @@ sub create_menu { next if (($name eq "") || ($name =~ /--/)); my $menu_item = $menu->{"${parent}${name}"}; - my $item = { 'title' => $locale->text($name) }; + my $item = { 'title' => $::locale->text($name) }; push @{ $all_items }, $item; if ($menu_item->{submenu} || !defined($menu_item->{module}) || ($menu_item->{module} eq "menu.pl")) { $item->{subitems} = []; + $item->{image} = _icon_path("$name.png"); create_menu($menu, $item->{subitems}, "${parent}${name}", $depth * 1 + 1); } else { + $item->{image} = _icon_path("${parent}${name}.png"); $menu->menuitem_new("${parent}${name}", $item); } } } + +sub _icon_path { + my ($label, $size) = @_; + + $size ||= 16; + + my $img = "image/icons/${size}x${size}/$label"; + + return unless -f $img; + return $img; +} +