Revision 9ad27e65
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/Layout/Base.pm | ||
---|---|---|
1 | 1 |
package SL::Layout::Base; |
2 | 2 |
|
3 | 3 |
use strict; |
4 |
use parent qw(SL::Controller::Base);
|
|
4 |
use parent qw(Rose::Object);
|
|
5 | 5 |
|
6 | 6 |
use List::MoreUtils qw(uniq); |
7 | 7 |
use Time::HiRes qw(); |
... | ... | |
18 | 18 |
); |
19 | 19 |
|
20 | 20 |
use SL::Menu; |
21 |
use SL::Presenter; |
|
21 | 22 |
|
22 | 23 |
my %menu_cache; |
23 | 24 |
|
... | ... | |
154 | 155 |
$_[0]{_header_done}; |
155 | 156 |
} |
156 | 157 |
|
158 |
sub presenter { |
|
159 |
SL::Presenter->get; |
|
160 |
} |
|
161 |
|
|
157 | 162 |
1; |
SL/Layout/Javascript.pm | ||
---|---|---|
47 | 47 |
$callback = URI->new($callback)->rel($callback) if $callback; |
48 | 48 |
$callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/; |
49 | 49 |
|
50 |
$self->render("menu/menunew", { output => 0 },
|
|
50 |
$self->presenter->render("menu/menunew",
|
|
51 | 51 |
force_ul_width => 1, |
52 | 52 |
date => $self->clock_line, |
53 | 53 |
menu_items => $self->acc_menu, |
SL/Layout/MenuLeft.pm | ||
---|---|---|
15 | 15 |
my $self = shift; |
16 | 16 |
$self->SUPER::javascripts_inline; |
17 | 17 |
my $sections = [ section_menu($self->menu) ]; |
18 |
$self->render('menu/menu', { output => 0 },
|
|
18 |
$self->presenter->render('menu/menu',
|
|
19 | 19 |
sections => $sections, |
20 | 20 |
) |
21 | 21 |
} |
SL/Layout/None.pm | ||
---|---|---|
14 | 14 |
s/y+/yy/gi; |
15 | 15 |
} $::myconfig{dateformat}; |
16 | 16 |
|
17 |
return $self->render( |
|
17 |
return $self->presenter->render(
|
|
18 | 18 |
'layout/javascript_setup', |
19 |
{ type => 'js', output => 0, },
|
|
19 |
{ type => 'js' }, |
|
20 | 20 |
datefmt => $datefmt, |
21 | 21 |
focus => $::request->layout->focus, |
22 | 22 |
ajax_spinner => 1, |
SL/Layout/Top.pm | ||
---|---|---|
6 | 6 |
sub pre_content { |
7 | 7 |
my ($self) = @_; |
8 | 8 |
|
9 |
$self->SUPER::render('menu/header', { output => 0 },
|
|
9 |
$self->presenter->render('menu/header',
|
|
10 | 10 |
now => DateTime->now_local, |
11 | 11 |
is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i), |
12 | 12 |
is_links => scalar($ENV{HTTP_USER_AGENT} =~ /links/i)); |
SL/Layout/V3.pm | ||
---|---|---|
164 | 164 |
$callback = URI->new($callback)->rel($callback) if $callback; |
165 | 165 |
$callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/; |
166 | 166 |
|
167 |
$self->SUPER::render('menu/menuv3', { output => 0 },
|
|
167 |
$self->presenter->render('menu/menuv3',
|
|
168 | 168 |
force_ul_width => 1, |
169 | 169 |
date => $self->clock_line, |
170 | 170 |
menu => $self->print_menu, |
t/controllers/base/render.t | ||
---|---|---|
7 | 7 |
use Support::TestSetup; |
8 | 8 |
|
9 | 9 |
use SL::Presenter; |
10 |
use SL::Controller::Base; |
|
11 |
use SL::Layout::Javascript; |
|
10 | 12 |
|
11 | 13 |
no warnings 'uninitialized'; |
12 | 14 |
|
Auch abrufbar als: Unified diff
Layout auf Presenter umgestellt.
Behebt circular includes von SL::Layout::Base -> SL::Controller::Base -> SL::Request -> SL::Layout::Base