1 package SL::Layout::Css;
5 use List::Util qw(max);
6 use Exporter qw(import);
8 our @EXPORT = qw(clock_line print_menu menuitem_v3);
11 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
12 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
16 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
17 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
19 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
20 "Donnerstag", "Freitag", "Samstag");
21 my @Monatsnamen = ("", "Januar", "Februar", "März",
22 "April", "Mai", "Juni", "Juli",
23 "August", "September", "Oktober", "November",
26 $Wochentage[$Wochentag] . ", der "
33 my ($self, $parent, $depth) = @_;
37 die if ($depth * 1 > 5);
40 my $menu = $self->menu;
42 @menuorder = $menu->access_control(\%::myconfig, $parent);
44 $parent .= "--" if ($parent);
46 foreach my $item (@menuorder) {
47 substr($item, 0, length($parent)) = "";
48 next if (($item eq "") || ($item =~ /--/));
50 my $menu_item = $menu->{"${parent}${item}"};
51 my $menu_title = $::locale->text($item);
52 my $menu_text = $menu_title;
54 if ($menu_item->{"submenu"} || !defined($menu_item->{"module"})) {
56 my $h = $self->print_menu("${parent}${item}", $depth * 1 + 1)."\n";
58 $html .= qq|<ul><li><h2>${menu_text}</h2><ul>${h}</ul></li></ul>\n|;
60 $html .= qq|<li><div class="x">${menu_text}</div><ul>${h}</ul></li>\n|;
63 if ($self->{sub_class} && $depth > 1) {
64 $html .= qq|<li class='sub'>|;
68 $html .= $self->menuitem_v3("${parent}$item", { "title" => $menu_title });
69 $html .= qq|${menu_text}</a></li>\n|;
77 $main::lxdebug->enter_sub();
79 my ($self, $item, $other) = @_;
80 my $menuitem = $self->menu->{$item};
82 my $action = "section_menu";
85 if ($menuitem->{module}) {
86 $module = $menuitem->{module};
88 if ($menuitem->{action}) {
89 $action = $menuitem->{action};
92 my $level = $::form->escape($item);
94 my $str = qq|<a href="$module?action=| . $::form->escape($action) . qq|&level=| . $::form->escape($level);
96 my @vars = qw(module action target href);
98 if ($menuitem->{href}) {
99 $str = qq|<a href=$menuitem->{href}|;
100 @vars = qw(module target href);
103 map { delete $menuitem->{$_} } @vars;
106 foreach my $key (keys %{ $menuitem }) {
107 $str .= "&" . $::form->escape($key, 1) . "=";
108 my ($value, $conf) = split(/=/, $menuitem->{$key}, 2);
109 $value = $::myconfig{$value} . "/$conf" if ($conf);
110 $str .= $::form->escape($value, 1);
116 foreach my $key (keys(%{$other})) {
117 $str .= qq| ${key}="| . $::form->quote($other->{$key}) . qq|"|;
123 $main::lxdebug->leave_sub();