From 7e161f1f2c66ebe4163635515a8edcde71040589 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 21 Feb 2012 18:06:40 +0100 Subject: [PATCH] =?utf8?q?Icons=20im=20Javascriptmen=C3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/menunew.pl | 11 +++++++++++ templates/webpages/menu/menunew.html | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/menunew.pl b/bin/mozilla/menunew.pl index 6b4f97175..751164e6c 100644 --- a/bin/mozilla/menunew.pl +++ b/bin/mozilla/menunew.pl @@ -137,10 +137,21 @@ 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; + + return "image/icons/${size}x${size}/$label"; +} + diff --git a/templates/webpages/menu/menunew.html b/templates/webpages/menu/menunew.html index c402f1bf6..164533990 100644 --- a/templates/webpages/menu/menunew.html +++ b/templates/webpages/menu/menunew.html @@ -38,7 +38,7 @@ window.onload=clockon