X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FLayout%2FV3.pm;h=dc39a18871165be25429c2e4f25fa83373f2897f;hb=e3dfdb7a78f6e0bc8ac1075fedc36f8247c6fd92;hp=3d0b2c03f535d47fd1168033ef19e72d22d77ad0;hpb=ab36799f821da4080a2d53654b36521a03240018;p=kivitendo-erp.git
diff --git a/SL/Layout/V3.pm b/SL/Layout/V3.pm
index 3d0b2c03f..dc39a1887 100644
--- a/SL/Layout/V3.pm
+++ b/SL/Layout/V3.pm
@@ -3,173 +3,23 @@ package SL::Layout::V3;
use strict;
use parent qw(SL::Layout::Base);
-use URI;
-
-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"}) && !defined($menu_item->{href})) {
-
- my $h = $self->print_menu("${parent}${item}", $depth * 1 + 1)."\n";
- if (!$parent) {
- $html .= qq|
\n|;
- } else {
- $html .= qq|${menu_text}
\n|;
- }
- } else {
- if ($self->{sub_class} && $depth > 1) {
- $html .= qq||;
- } else {
- $html .= qq||;
- }
- $html .= $self->menuitem_v3("${parent}$item", { "title" => $menu_title });
- $html .= qq|${menu_text}\n|;
- }
- }
-
- return $html;
-}
-
-sub menuitem_v3 {
- $main::lxdebug->enter_sub();
-
- my ($self, $item, $other) = @_;
- my $menuitem = $self->menu->{$item};
-
- my $action = "section_menu";
- my $module;
-
- if ($menuitem->{module}) {
- $module = $menuitem->{module};
- }
- if ($menuitem->{action}) {
- $action = $menuitem->{action};
- }
-
- my $level = $::form->escape($item);
-
- my @vars;
- my $target = $menuitem->{target} ? qq| target="| . $::form->escape($menuitem->{target}) . '"' : '';
- my $str = qq|';
- }
-
- $str .= qq|$module?action=| . $::form->escape($action);
-
- map { delete $menuitem->{$_} } qw(module action target href);
-
- # add other params
- foreach my $key (keys %{ $menuitem }) {
- $str .= "&" . $::form->escape($key, 1) . "=";
- my ($value, $conf) = split(/=/, $menuitem->{$key}, 2);
- $value = $::myconfig{$value} . "/$conf" if ($conf);
- $str .= $::form->escape($value, 1);
- }
-
- $str .= '"';
-
- if ($other) {
- foreach my $key (keys(%{$other})) {
- $str .= qq| ${key}="| . $::form->quote($other->{$key}) . qq|"|;
- }
- }
-
- $str .= ">";
-
- $main::lxdebug->leave_sub();
-
- return $str;
-}
+use SL::Layout::None;
+use SL::Layout::Top;
+use SL::Layout::CssMenu;
+use SL::Layout::ActionBar;
+use SL::Layout::Content;
sub init_sub_layouts {
- [ SL::Layout::None->new ]
-}
+ $_[0]->sub_layouts_by_name->{actionbar} = SL::Layout::ActionBar->new;
-sub use_stylesheet {
- my $self = shift;
- qw(
- icons16.css frame_header/header.css
- ),
- $self->SUPER::use_stylesheet(@_);
+ [
+ SL::Layout::None->new,
+ SL::Layout::Top->new,
+ SL::Layout::CssMenu->new,
+ $_[0]->sub_layouts_by_name->{actionbar},
+ SL::Layout::Content->new,
+ ]
}
-sub use_javascript {
- my $self = shift;
- qw(
- js/quicksearch_input.js
- ),
- $self->SUPER::use_javascript(@_);
-}
-
-sub pre_content {
- $_[0]->render;
-}
-
-sub start_content {
- "\n";
-}
-
-sub end_content {
- "
\n";
-}
-
-sub render {
- my ($self) = @_;
-
- my $callback = $::form->unescape($::form->{callback});
- $callback = URI->new($callback)->rel($callback) if $callback;
- $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
-
- $self->presenter->render('menu/menuv3',
- force_ul_width => 1,
- date => $self->clock_line,
- menu => $self->print_menu,
- callback => $callback,
- );
-}
1;