From: Sven Schöling Date: Mon, 3 Sep 2012 11:14:02 +0000 (+0200) Subject: auf volle anzeige und javascript umgestellt X-Git-Tag: release-3.0.0beta1~212 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7adc5519c0e80de857987eff6a9a97f3f4e5a6ce;p=kivitendo-erp.git auf volle anzeige und javascript umgestellt bugs: - ausklappen klappt nicht alles andere ein - ausklappen klappt berichte und abwärts nicht mit aus - interne nummerierung ist noch bogus --- diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl index 16d8b75ae..21dbe0c5e 100644 --- a/bin/mozilla/menu.pl +++ b/bin/mozilla/menu.pl @@ -45,7 +45,6 @@ use URI; use List::MoreUtils qw(apply); my $nbsp = ' '; -my $mainlevel; # end of main @@ -81,13 +80,16 @@ sub acc_menu { my $framesize = _calc_framesize() - 2; my $menu = Menu->new("menu.ini"); - $mainlevel = $::form->{level}; $::form->{title} = $::locale->text('kivitendo'); $::form->header; + $::lxdebug->dump(0, "menu", $menu); + + my $sections = section_menu($menu); + print $::form->parse_html_template('menu/menu', { framesize => $framesize, - sections => [ section_menu($menu) ], + sections => $sections, }); $::lxdebug->leave_sub; @@ -103,7 +105,6 @@ sub section_menu { my $menuitem = $menu->{$item}; my $label = apply { s/.*--// } $item; my $ml = apply { s/--.*// } $item; - my $show = $ml eq $mainlevel; my $spacer = $nbsp x (($item =~ s/--/--/g) * 2); my $label_icon = $level . "--" . $label . ".png"; @@ -128,34 +129,40 @@ sub section_menu { my $anchor = $menuitem->{href}; if (!$level) { # toplevel - my $ml_ = $::form->escape($ml); - my $image = make_image(icon => $item . '.png', size => 24, label => $label); - my $anchor = "menu.pl?action=acc_menu&level=$ml_"; - - push @items, make_item(href => $anchor, img => $image, label => $label, height => 24, class => 'menu'); - push @items, section_menu($menu, $item); - + push @items, make_item( + href => '#', + img => make_image(icon => $item . '.png', size => 24, label => $label), + label => $label, + height => 24, + class => 'menu', + subitems => section_menu($menu, $item) + ); } elsif ($menuitem->{submenu}) { - my $image = make_image(submenu => 1); - if ($mainlevel && $item =~ /^\Q$mainlevel\E/) { - push @items, make_item(target => $menuitem->{target}, spacer => $spacer, img => $image, label => $label, class => 'submenu') if $show; - push @items, section_menu($menu, $item); - } else { - push @items, make_item(spacer => $spacer, href => $anchor, img => $image, label => $label . ' ...', class => 'submenu') if $show; - } + push @items, make_item( + target => $menuitem->{target}, + spacer => $spacer, + img => make_image(submenu => 1), + label => $label, + class => 'submenu', + subitems => section_menu($menu, $item), + ); } elsif ($menuitem->{module}) { - my $image = make_image(label => $label, icon => $label_icon); - push @items, make_item(target => $menuitem->{target}, img => $image, href => $anchor, spacer => $spacer, label => $label, class => 'item') if $show; - push @items, section_menu($menu, $item) if $show && $::form->{$item} && $::form->{level} eq $item; + push @items, make_item( + target => $menuitem->{target}, + img => make_image(label => $label, icon => $label_icon), + href => $anchor, + spacer => $spacer, + label => $label, + class => 'item', + ); } } $::lxdebug->leave_sub; - return @items; + return \@items; } sub make_item { my %params = @_; - $params{a} ||= ''; $params{spacer} ||= ''; $params{height} ||= 16; @@ -203,7 +210,6 @@ sub make_image { alt => $params{label}, width => $icon_found ? $size : 24, height => $size, - padding => $padding, } } diff --git a/templates/webpages/menu/menu.html b/templates/webpages/menu/menu.html index 25081d4f2..e4f89d903 100644 --- a/templates/webpages/menu/menu.html +++ b/templates/webpages/menu/menu.html @@ -7,24 +7,49 @@ #html-menu img { vertical-align: middle; visibility:hidden; border: 0; } #html-menu div.menuitem:first-child img { visibility:visible } #html-menu a { vertical-align: top } + #html-menu .item span.menu-spacer { display: inline-block; width: 24px } + #html-menu .menu span.menu-spacer { display: inline-block; width: 32px }
- + [% INCLUDE sections %] +
+ + +[%- BLOCK sections %] [%- FOREACH item IN sections %] [%- END %] - +[%- END %] +[%- BLOCK item %] + [% item.spacer %] + [%- IF item.href %] + [% L.link(item.href, L.html_tag('span', L.html_tag('img', undef, item.img), class='menu-spacer') _ chunk, target=item.target) %] + [%- ELSE %] + [% L.html_tag('img', undef, item.img) _ chunk %] + [%- END %] +[%- END %] + - + +