Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8660390c

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID 8660390cf291a037ce540f0c3372e6f213938e50
  • Vorgänger fb95b353
  • Nachfolger 46231fcc

Menüs: "target=..." wieder unterstützt

Unterschiede anzeigen:

SL/Layout/MenuLeft.pm
70 70
      $menuitem->{href} .= $::form->escape($value, 1);
71 71
    }
72 72

  
73
    my $anchor = $menuitem->{href};
74

  
75 73
    my @common_args = ($label, $spacer, "$id_prefix\_$id");
76 74

  
77 75
    if (!$level) { # toplevel
......
83 81
      #make_image(label => 'submenu'),
84 82
      push @items, section_menu($menu, $item, "$id_prefix\_$id");
85 83
    } elsif ($menuitem->{module}) {
86
      push @items, [ @common_args, "icon16 $icon_class", 'i', $anchor ];
84
      push @items, [ @common_args, "icon16 $icon_class", 'i', $menuitem->{href}, $menuitem->{target} ];
87 85
      #make_image(size => 16, label => $item),
88 86
    }
89 87
  } continue {
......
129 127
  2: unique id
130 128
  3: icon classes
131 129
  4: role classes
130
  5: href
131
  6: target
132 132

  
133 133
From each entry the following dom will be generated, with [0] being entry 0 of
134 134
the data array:
SL/Layout/V3.pm
87 87
    $action = $menuitem->{action};
88 88
  }
89 89

  
90
  my $level = $::form->escape($item);
90
  my $level  = $::form->escape($item);
91 91

  
92
  my $str = qq|<a href="$module?action=| . $::form->escape($action) . qq|&level=| . $::form->escape($level);
93

  
94
  my @vars = qw(module action target href);
92
  my @vars;
93
  my $target = $menuitem->{target} ? qq| target="| . $::form->escape($menuitem->{target}) . '"' : '';
94
  my $str    = qq|<a${target} href="|;
95 95

  
96 96
  if ($menuitem->{href}) {
97
    $str  = qq|<a href="$menuitem->{href}|;
98
    @vars = qw(module target href);
97
    $main::lxdebug->leave_sub();
98
    return $str . $menuitem->{href} . '">';
99 99
  }
100 100

  
101
  map { delete $menuitem->{$_} } @vars;
101
  $str .= qq|$module?action=| . $::form->escape($action) . qq|&level=| . $::form->escape($level);
102

  
103
  map { delete $menuitem->{$_} } qw(module action target href);
102 104

  
103 105
  # add other params
104 106
  foreach my $key (keys %{ $menuitem }) {
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[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()})})})
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]);if(b[6])a.attr('target', b[6]);$('#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