Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e161f1f

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID 7e161f1f2c66ebe4163635515a8edcde71040589
  • Vorgänger 6257a194
  • Nachfolger 4e940c56

Icons im Javascriptmenü

Unterschiede anzeigen:

bin/mozilla/menunew.pl
137 137

  
138 138
    if ($menu_item->{submenu} || !defined($menu_item->{module}) || ($menu_item->{module} eq "menu.pl")) {
139 139
      $item->{subitems} = [];
140
      $item->{image} = _icon_path("$name.png");
140 141
      create_menu($menu, $item->{subitems}, "${parent}${name}", $depth * 1 + 1);
141 142

  
142 143
    } else {
144
      $item->{image} = _icon_path("${parent}${name}.png");
143 145
      $menu->menuitem_new("${parent}${name}", $item);
144 146
    }
145 147
  }
146 148
}
149

  
150
sub _icon_path {
151
  my ($label, $size) = @_;
152

  
153
  $size ||= 16;
154

  
155
  return "image/icons/${size}x${size}/$label";
156
}
157

  
templates/webpages/menu/menunew.html
38 38
 <ul id="main_menu_model">
39 39
 [%- FOREACH mainitem = menu_items %]
40 40
  [%- SET main_id = main_id + 1 %]
41
  <li id="[% main_id %]">
41
  <li id="[% main_id %]"[% IF mainitem.image %] itemIcon="[% mainitem.image %]"[% END %]>
42 42
   <a href="[% IF mainitem.href %][% mainitem.href %][% ELSE %]#[% END %]"[% IF mainitem.target %] target="[% mainitem.target %]"[% END %]>
43 43
    [%- HTML.escape(mainitem.title) %]
44 44
   </a>
......
47 47
     [%- SET sub1_id = main_id * 100 %]
48 48
     [%- FOREACH sub1item = mainitem.subitems %]
49 49
      [%- SET sub1_id = sub1_id + 1 %]
50
      <li id="[% sub1_id %]">
50
      <li id="[% sub1_id %]"[% IF sub1item.image %] itemIcon="[% sub1item.image %]"[% END %]>
51 51
       <a href="[% IF sub1item.href %][% sub1item.href %][% ELSE %]#[% END %]"[% IF sub1item.target %] target="[% sub1item.target %]"[% END %]>
52 52
        [%- HTML.escape(sub1item.title) %]
53 53
       </a>
......
56 56
         [%- SET sub2_id = sub1_id * 100 %]
57 57
         [%- FOREACH sub2item = sub1item.subitems %]
58 58
          [%- SET sub2_id = sub2_id + 1 %]
59
          <li id="[% sub2_id %]">
59
          <li id="[% sub2_id %]"[% IF sub2item.image %] itemIcon="[% sub2item.image %]"[% END %]>
60 60
           <a href="[% IF sub2item.href %][% sub2item.href %][% ELSE %]#[% END %]"[% IF sub2item.target %] target="[% sub2item.target %]"[% END %]>
61 61
            [%- HTML.escape(sub2item.title) %]
62 62
           </a>

Auch abrufbar als: Unified diff