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
37 frame_header/header.css
40 $_[0]->SUPER::stylesheets;
45 my $form = $main::form;
47 my $callback = $form->unescape($form->{callback});
48 $callback = URI->new($callback)->rel($callback) if $callback;
49 $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
51 $self->presenter->render("menu/menunew",
53 date => $self->clock_line,
54 menu_items => $self->acc_menu,
55 callback => $callback,
60 my $form = $main::form;
62 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
63 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
67 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
68 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
70 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
71 "Donnerstag", "Freitag", "Samstag");
72 my @Monatsnamen = ("", "Januar", "Februar", "März",
73 "April", "Mai", "Juni", "Juli",
74 "August", "September", "Oktober", "November",
77 $Wochentage[$Wochentag] . ", der "
86 my $menu = $self->menu;
89 $self->create_menu($menu, $all_items);
91 my $item = { 'subitems' => $all_items };
92 calculate_width($item);
100 $item->{max_width} = max map { length $_->{title} } @{ $item->{subitems} };
102 foreach my $subitem (@{ $item->{subitems} }) {
103 calculate_width($subitem) if ($subitem->{subitems});
108 my ($self, $menu, $all_items, $parent, $depth) = @_;
111 my $form = $main::form;
112 my %myconfig = %main::myconfig;
116 die if ($depth * 1 > 5);
118 my @menuorder = $menu->access_control(\%myconfig, $parent);
119 $parent .= "--" if ($parent);
122 foreach my $name (@menuorder) {
123 substr($name, 0, length($parent), "");
124 next if (($name eq "") || ($name =~ /--/));
126 my $menu_item = $menu->{"${parent}${name}"};
127 my $item = { 'title' => $::locale->text($name) };
128 push @{ $all_items }, $item;
130 if ($menu_item->{submenu} || (!defined($menu_item->{module}) && !defined($menu_item->{href}))) {
131 $item->{subitems} = [];
132 $item->{image} = _icon_path("$name.png");
133 $self->create_menu($menu, $item->{subitems}, "${parent}${name}", $depth * 1 + 1);
136 $item->{image} = _icon_path("${parent}${name}.png");
137 $menu->menuitem_new("${parent}${name}", $item);
143 my ($label, $size) = @_;
147 my $img = "image/icons/${size}x${size}/$label";
149 return unless -f $img;