From 62822c6ab826078a7f17422dc29e1ceeaf7e311e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 6 Sep 2012 20:53:19 +0200 Subject: [PATCH] =?utf8?q?Sprites=20f=C3=BCr=20das=20Men=C3=BC=20verwenden?= =?utf8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/menu.pl | 42 +++++++------------------------ css/lx-office-erp/menu.css | 5 ++-- templates/webpages/menu/menu.html | 4 +-- 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl index 459ccddc9..fb4a81bdd 100644 --- a/bin/mozilla/menu.pl +++ b/bin/mozilla/menu.pl @@ -76,6 +76,8 @@ sub display { sub acc_menu { $::lxdebug->enter_sub; + $::form->{stylesheet} = [ qw(css/icons16.css css/icons24.css ) ]; + my $framesize = _calc_framesize() - 2; my $menu = Menu->new("menu.ini"); $::form->{title} = $::locale->text('kivitendo'); @@ -101,14 +103,14 @@ sub section_menu { for my $item (@menuorder) { my $menuitem = $menu->{$item}; - my $label = apply { s/.*--// } $item; + my $olabel = apply { s/.*--// } $item; my $ml = apply { s/--.*// } $item; + my $icon_class = apply { y/ /-/ } $item; my $spacer = "s" . (0 + $item =~ s/--/--/g); - my $label_icon = $level . "--" . $label . ".png"; - next if $level && $item ne "$level--$label"; + next if $level && $item ne "$level--$olabel"; - $label = $::locale->text($label); + my $label = $::locale->text($olabel); $menuitem->{module} ||= $::form->{script}; $menuitem->{action} ||= "section_menu"; @@ -136,20 +138,20 @@ sub section_menu { if (!$level) { # toplevel push @items, { %common_args, - img => make_image(icon => $item . '.png', size => 24, label => $label), + img => "icon24 $icon_class", # make_image(size => 24, label => $item), height => 24, class => 'm', }; push @items, section_menu($menu, $item, "$id_prefix\_$id"); } elsif ($menuitem->{submenu}) { push @items, { %common_args, - img => make_image(submenu => 1), + img => "icon16 submenu", #make_image(label => 'submenu'), class => 'sm', }; push @items, section_menu($menu, $item, "$id_prefix\_$id"); } elsif ($menuitem->{module}) { push @items, { %common_args, - img => make_image(label => $label, icon => $label_icon), + img => "icon16 $icon_class", #make_image(size => 16, label => $item), href => $anchor, class => 'i', }; @@ -162,24 +164,6 @@ sub section_menu { return @items; } -sub make_image { - my (%params) = @_; - - my $icon = $params{icon}; - my $size = $params{size} || 16; - - return unless _show_images(); - - my $icon_found = $icon && -f _icon_path($icon, $size); - - return { - src => $icon_found ? _icon_path($icon, $size) : "image/unterpunkt.png", - alt => $params{label}, - width => $icon_found ? $size : 24, - height => $icon_found ? $size : 15, - } -} - sub _calc_framesize { my $is_lynx_browser = $ENV{HTTP_USER_AGENT} =~ /links/i; my $is_mobile_browser = $ENV{HTTP_USER_AGENT} =~ /mobile/i; @@ -195,14 +179,6 @@ sub _show_images { _calc_framesize() != 240; } -sub _icon_path { - my ($label, $size) = @_; - - $size ||= 16; - - return "image/icons/${size}x${size}/$label"; -} - 1; __END__ diff --git a/css/lx-office-erp/menu.css b/css/lx-office-erp/menu.css index 90cc0c813..ed6e7e5bf 100644 --- a/css/lx-office-erp/menu.css +++ b/css/lx-office-erp/menu.css @@ -300,8 +300,9 @@ div#menuv4 li li li li:hover ul #html-menu div.sm { font-weight: bold } #html-menu img { vertical-align: top; border: 0; } #html-menu a { vertical-align: top } -#html-menu .i span.ms { float:left; width: 24px } -#html-menu .m span.ms { float:left; width: 32px } +#html-menu .i span.ms { float: left; width: 24px } +#html-menu .m span.ms { float: left; width: 32px } +#html-menu .sm span.ms { float: left; width: 24px; background: url(../../image/unterpunkt.png); } #html-menu div.m { height: 24px } #html-menu div.m span.mic { color:blue; position: relative; top: 5px; } #html-menu div.m:hover, diff --git a/templates/webpages/menu/menu.html b/templates/webpages/menu/menu.html index 5b24e805d..efe5d9a87 100644 --- a/templates/webpages/menu/menu.html +++ b/templates/webpages/menu/menu.html @@ -5,8 +5,8 @@
[%- FOREACH item IN sections %]
[%- IF item.href %] - [% L.img_tag(item.img) %][% item.label %][%- ELSE %] - [% L.img_tag(item.img) %][% item.label %][%- END %] +
[% item.label %]
[%- ELSE %] +
[% item.label %][%- END %]
[%- END %]
-- 2.20.1