besseres interface und delegating für layouts, inline accessoren
[kivitendo-erp.git] / SL / Controller / Layout / V4.pm
1 package SL::Controller::Layout::V4;
2
3 use strict;
4 use parent qw(SL::Controller::Layout::Base);
5 use SL::Controller::Layout::Css;
6 use SL::Controller::Layout::Top;
7
8 use URI;
9
10 sub new {
11   my ($class, @slurp) = @_;
12
13   my $self = $class->SUPER::new(@slurp);
14   $self->add_sub_layouts(SL::Controller::Layout::Top->new);
15   $self;
16 }
17
18 sub start_content {
19   "<div id='content'>\n";
20 }
21
22 sub end_content {
23   "</div>\n";
24 }
25
26 sub pre_content {
27   my ($self) = @_;
28
29   $self->{sub_class} = 1;
30
31   my $callback            = $::form->unescape($::form->{callback});
32   $callback               = URI->new($callback)->rel($callback) if $callback;
33   $callback               = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
34
35   $self->SUPER::pre_content .
36
37   $self->SUPER::render('menu/menuv4', { no_menu => 1, no_output => 1 },
38     force_ul_width => 1,
39     date           => $self->clock_line,
40     menu           => $self->print_menu,
41     callback       => $callback,
42   );
43 }
44
45 1;