X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fmenunew.pl;h=a1f9a8f2d0169102906a7a4a1696150167fc3879;hb=6881b4bd6a669dd991b227ecf41c3e8662806595;hp=6b4f97175a4f371166c1ca8c7bd137f10d694276;hpb=c7edb24800396748f2bf1e40ff05f90a18d31b02;p=kivitendo-erp.git diff --git a/bin/mozilla/menunew.pl b/bin/mozilla/menunew.pl index 6b4f97175..a1f9a8f2d 100644 --- a/bin/mozilla/menunew.pl +++ b/bin/mozilla/menunew.pl @@ -137,10 +137,24 @@ sub create_menu { 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; +} +