Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6fd839ca

Von Sven Schöling vor etwa 12 Jahren hinzugefügt

  • ID 6fd839ca475e7bc845eeff171acf670c996ae3f9
  • Vorgänger 017c6569
  • Nachfolger 09bff7bf

menu auf arrays umgestellt

Unterschiede anzeigen:

SL/Controller/Layout/MenuLeft.pm
7 7

  
8 8
use List::MoreUtils qw(apply);
9 9

  
10
sub new {
11
  my ($class, @slurp) = @_;
12

  
13
  my $self = $class->SUPER::new(@slurp);
14

  
15
  $self;
16
}
17

  
18 10
sub stylesheets {
19 11
  qw(css/icons16.css css/icons24.css)
20 12
}
......
73 65

  
74 66
    my $anchor = $menuitem->{href};
75 67

  
76
    my %common_args = (
77
        l   => $label,
78
        s  => $spacer,
79
        id => "$id_prefix\_$id",
80
    );
68
    my @common_args = ($label, $spacer, "$id_prefix\_$id");
81 69

  
82 70
    if (!$level) { # toplevel
83
      push @items, { %common_args,
84
        i      => "icon24 $icon_class",   #  make_image(size => 24, label => $item),
85
        c    => 'm',
86
      };
71
      push @items, [ @common_args, "icon24 $icon_class", 'm' ];
72
      #  make_image(size => 24, label => $item),
87 73
      push @items, section_menu($menu, $item, "$id_prefix\_$id");
88 74
    } elsif ($menuitem->{submenu}) {
89
      push @items, { %common_args,
90
        i      => "icon16 submenu",   #make_image(label => 'submenu'),
91
        c    => 'sm',
92
      };
75
      push @items, [ @common_args, "icon16 submenu", 'sm' ];
76
      #make_image(label => 'submenu'),
93 77
      push @items, section_menu($menu, $item, "$id_prefix\_$id");
94 78
    } elsif ($menuitem->{module}) {
95
      push @items, { %common_args,
96
        i     => "icon16 $icon_class",  #make_image(size => 16, label => $item),
97
        h    => $anchor,
98
        c   => 'i',
99
      };
79
      push @items, [ @common_args, "icon16 $icon_class", 'i', $anchor ];
80
      #make_image(size => 16, label => $item),
100 81
    }
101 82
  } continue {
102 83
    $id++;
templates/webpages/menu/menu.html
1 1
[%- USE JSON %]
2
$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b.i)),$('<span class="mic">').append(b.l));if(b.h)a.attr('href', b.h);if(b.t)a.attr('target', b.t);$('#html-menu').append($('<div class="mi">').addClass(b.c).addClass(b.s).attr('id','mi'+b.id).append(a))});$('#html-menu div.i, #html-menu div.sm').not('[id^='+$.cookie('html-menu-selection')+'_]').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$.cookie('html-menu-selection',$(this).attr('id'));$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})
2
$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b[3])),$('<span class="mic">').append(b[0]));if(b[5])a.attr('href', b[5]);$('#html-menu').append($('<div class="mi">').addClass(b[4]).addClass(b[1]).attr('id','mi'+b[2]).append(a))});$('#html-menu div.i, #html-menu div.sm').not('[id^='+$.cookie('html-menu-selection')+'_]').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$.cookie('html-menu-selection',$(this).attr('id'));$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})

Auch abrufbar als: Unified diff