1 package SL::Controller::Layout::MenuLeft;
4 use parent qw(SL::Controller::Layout::Base);
8 use List::MoreUtils qw(apply);
11 qw(css/icons16.css css/icons24.css);
16 my $sections = [ section_menu($self->menu) ];
18 $self->SUPER::render('menu/menu', { no_menu => 1, no_output => 1 },
19 sections => $sections,
24 $::lxdebug->enter_sub(2);
25 my ($menu, $level, $id_prefix) = @_;
26 my @menuorder = $menu->access_control(\%::myconfig, $level);
31 for my $item (@menuorder) {
32 my $menuitem = $menu->{$item};
33 my $olabel = apply { s/.*--// } $item;
34 my $ml = apply { s/--.*// } $item;
35 my $icon_class = apply { y/ /-/ } $item;
36 my $spacer = "s" . (0 + $item =~ s/--/--/g);
38 next if $level && $item ne "$level--$olabel";
40 my $label = $::locale->text($olabel);
42 $menuitem->{module} ||= $::form->{script};
43 $menuitem->{action} ||= "section_menu";
44 $menuitem->{href} ||= "$menuitem->{module}?action=$menuitem->{action}";
47 foreach my $key (keys %$menuitem) {
48 next if $key =~ /target|module|action|href/;
49 $menuitem->{href} .= "&" . $::form->escape($key, 1) . "=";
50 my ($value, $conf) = split(/=/, $menuitem->{$key}, 2);
51 $value = $::myconfig{$value} . "/$conf" if ($conf);
52 $menuitem->{href} .= $::form->escape($value, 1);
55 my $anchor = $menuitem->{href};
60 id => "$id_prefix\_$id",
63 if (!$level) { # toplevel
64 push @items, { %common_args,
65 i => "icon24 $icon_class", # make_image(size => 24, label => $item),
68 push @items, section_menu($menu, $item, "$id_prefix\_$id");
69 } elsif ($menuitem->{submenu}) {
70 push @items, { %common_args,
71 i => "icon16 submenu", #make_image(label => 'submenu'),
74 push @items, section_menu($menu, $item, "$id_prefix\_$id");
75 } elsif ($menuitem->{module}) {
76 push @items, { %common_args,
77 i => "icon16 $icon_class", #make_image(size => 16, label => $item),
86 $::lxdebug->leave_sub(2);
91 my $is_lynx_browser = $ENV{HTTP_USER_AGENT} =~ /links/i;
92 my $is_mobile_browser = $ENV{HTTP_USER_AGENT} =~ /mobile/i;
93 my $is_mobile_style = $::form->{stylesheet} =~ /mobile/i;
95 return $is_mobile_browser && $is_mobile_style ? 130
96 : $is_lynx_browser ? 240
101 # don't show images in links
102 _calc_framesize() != 240;