1 package SL::Layout::Javascript;
4 use parent qw(SL::Layout::Base);
6 use List::Util qw(max);
10 [ SL::Layout::None->new ]
16 js/quicksearch_input.js
18 $self->SUPER::use_javascript(@_);
26 "<div id='content'>\n";
34 $_[0]->add_stylesheets(qw(
35 dhtmlsuite/menu-item.css
36 dhtmlsuite/menu-bar.css
39 $_[0]->SUPER::stylesheets;
44 my $form = $main::form;
46 my $callback = $form->unescape($form->{callback});
47 $callback = URI->new($callback)->rel($callback) if $callback;
48 $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
50 $self->presenter->render("menu/menunew",
52 date => $self->clock_line,
53 menu_items => $self->acc_menu,
54 callback => $callback,
59 my $form = $main::form;
61 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
62 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
66 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
67 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
69 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
70 "Donnerstag", "Freitag", "Samstag");
71 my @Monatsnamen = ("", "Januar", "Februar", "März",
72 "April", "Mai", "Juni", "Juli",
73 "August", "September", "Oktober", "November",
76 $Wochentage[$Wochentag] . ", der "
85 my $menu = $self->menu;
88 $self->create_menu($menu, $all_items);
90 my $item = { 'subitems' => $all_items };
91 calculate_width($item);
99 $item->{max_width} = max map { length $_->{title} } @{ $item->{subitems} };
101 foreach my $subitem (@{ $item->{subitems} }) {
102 calculate_width($subitem) if ($subitem->{subitems});
107 my ($self, $menu, $all_items, $parent, $depth) = @_;
110 my $form = $main::form;
111 my %myconfig = %main::myconfig;
115 die if ($depth * 1 > 5);
117 my @menuorder = $menu->access_control(\%myconfig, $parent);
118 $parent .= "--" if ($parent);
121 foreach my $name (@menuorder) {
122 substr($name, 0, length($parent), "");
123 next if (($name eq "") || ($name =~ /--/));
125 my $menu_item = $menu->{"${parent}${name}"};
126 my $item = { 'title' => $::locale->text($name) };
127 push @{ $all_items }, $item;
129 if ($menu_item->{submenu} || (!defined($menu_item->{module}) && !defined($menu_item->{href}))) {
130 $item->{subitems} = [];
131 $item->{image} = _icon_path("$name.png");
132 $self->create_menu($menu, $item->{subitems}, "${parent}${name}", $depth * 1 + 1);
135 $item->{image} = _icon_path("${parent}${name}.png");
136 $menu->menuitem_new("${parent}${name}", $item);
142 my ($label, $size) = @_;
146 my $img = "image/icons/${size}x${size}/$label";
148 return unless -f $img;