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
38 frame_header/header.css
41 $_[0]->SUPER::stylesheets;
46 my $form = $main::form;
48 my $callback = $form->unescape($form->{callback});
49 $callback = URI->new($callback)->rel($callback) if $callback;
50 $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
52 $self->presenter->render("menu/menunew",
54 date => $self->clock_line,
55 menu_items => $self->acc_menu,
56 callback => $callback,
61 my $form = $main::form;
63 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
64 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
68 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
69 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
71 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
72 "Donnerstag", "Freitag", "Samstag");
73 my @Monatsnamen = ("", "Januar", "Februar", "März",
74 "April", "Mai", "Juni", "Juli",
75 "August", "September", "Oktober", "November",
78 $Wochentage[$Wochentag] . ", der "
87 my $menu = $self->menu;
90 $self->create_menu($menu, $all_items);
92 my $item = { 'subitems' => $all_items };
93 calculate_width($item);
101 $item->{max_width} = max map { length $_->{title} } @{ $item->{subitems} };
103 foreach my $subitem (@{ $item->{subitems} }) {
104 calculate_width($subitem) if ($subitem->{subitems});
109 my ($self, $menu, $all_items, $parent, $depth) = @_;
112 my $form = $main::form;
113 my %myconfig = %main::myconfig;
117 die if ($depth * 1 > 5);
119 my @menuorder = $menu->access_control(\%myconfig, $parent);
120 $parent .= "--" if ($parent);
123 foreach my $name (@menuorder) {
124 substr($name, 0, length($parent), "");
125 next if (($name eq "") || ($name =~ /--/));
127 my $menu_item = $menu->{"${parent}${name}"};
128 my $item = { 'title' => $::locale->text($name) };
129 push @{ $all_items }, $item;
131 if ($menu_item->{submenu} || (!defined($menu_item->{module}) && !defined($menu_item->{href}))) {
132 $item->{subitems} = [];
133 $item->{image} = _icon_path("$name.png");
134 $self->create_menu($menu, $item->{subitems}, "${parent}${name}", $depth * 1 + 1);
137 $item->{image} = _icon_path("${parent}${name}.png");
138 $menu->menuitem_new("${parent}${name}", $item);
144 my ($label, $size) = @_;
148 my $img = "image/icons/${size}x${size}/$label";
150 return unless -f $img;