X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/fb005f3fd6f8684441c12d821c8d30a8720dcf16..b6fd15a8dc44f9b09d5a2bce766cda14b87c6e13:/SL/Layout/Css.pm diff --git a/SL/Layout/Css.pm b/SL/Layout/Css.pm new file mode 100644 index 000000000..2bb0455ca --- /dev/null +++ b/SL/Layout/Css.pm @@ -0,0 +1,129 @@ +package SL::Layout::Css; + +use strict; + +use List::Util qw(max); +use Exporter qw(import); + +our @EXPORT = qw(clock_line print_menu menuitem_v3); + +sub clock_line { + my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat, + $Jahr, $Wochentag, $Jahrestag, $Sommerzeit) + = localtime(time); + $Monat += 1; + $Jahrestag += 1; + $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat; + $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag; + $Jahr += 1900; + my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch", + "Donnerstag", "Freitag", "Samstag"); + my @Monatsnamen = ("", "Januar", "Februar", "März", + "April", "Mai", "Juni", "Juli", + "August", "September", "Oktober", "November", + "Dezember"); + return + $Wochentage[$Wochentag] . ", der " + . $Monatstag . "." + . $Monat . "." + . $Jahr . " - "; +} + +sub print_menu { + my ($self, $parent, $depth) = @_; + + my $html; + + die if ($depth * 1 > 5); + + my @menuorder; + my $menu = $self->menu; + + @menuorder = $menu->access_control(\%::myconfig, $parent); + + $parent .= "--" if ($parent); + + foreach my $item (@menuorder) { + substr($item, 0, length($parent)) = ""; + next if (($item eq "") || ($item =~ /--/)); + + my $menu_item = $menu->{"${parent}${item}"}; + my $menu_title = $::locale->text($item); + my $menu_text = $menu_title; + + if ($menu_item->{"submenu"} || !defined($menu_item->{"module"}) || + ($menu_item->{"module"} eq "menu.pl")) { + + my $h = $self->print_menu("${parent}${item}", $depth * 1 + 1)."\n"; + if (!$parent) { + $html .= qq|