Layout auf Presenter umgestellt.
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 14 Mar 2013 12:18:04 +0000 (13:18 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 14 Mar 2013 12:18:04 +0000 (13:18 +0100)
Behebt circular includes von SL::Layout::Base -> SL::Controller::Base -> SL::Request -> SL::Layout::Base

SL/Layout/Base.pm
SL/Layout/Javascript.pm
SL/Layout/MenuLeft.pm
SL/Layout/None.pm
SL/Layout/Top.pm
SL/Layout/V3.pm
t/controllers/base/render.t

index bd08d81..72b4876 100644 (file)
@@ -1,7 +1,7 @@
 package SL::Layout::Base;
 
 use strict;
-use parent qw(SL::Controller::Base);
+use parent qw(Rose::Object);
 
 use List::MoreUtils qw(uniq);
 use Time::HiRes qw();
@@ -18,6 +18,7 @@ use Rose::Object::MakeMethods::Generic (
 );
 
 use SL::Menu;
+use SL::Presenter;
 
 my %menu_cache;
 
@@ -154,4 +155,8 @@ sub need_footer {
   $_[0]{_header_done};
 }
 
+sub presenter {
+  SL::Presenter->get;
+}
+
 1;
index 2cda0f4..b08cf6d 100644 (file)
@@ -47,7 +47,7 @@ sub display {
   $callback               = URI->new($callback)->rel($callback) if $callback;
   $callback               = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
 
-  $self->render("menu/menunew", { output => 0 },
+  $self->presenter->render("menu/menunew",
     force_ul_width  => 1,
     date            => $self->clock_line,
     menu_items      => $self->acc_menu,
index d740640..9a47d29 100644 (file)
@@ -15,7 +15,7 @@ sub javascripts_inline {
   my $self = shift;
   $self->SUPER::javascripts_inline;
   my $sections = [ section_menu($self->menu) ];
-  $self->render('menu/menu', { output => 0 },
+  $self->presenter->render('menu/menu',
     sections  => $sections,
   )
 }
index 971ef85..4a02d65 100644 (file)
@@ -14,9 +14,9 @@ sub javascripts_inline {
     s/y+/yy/gi;
   } $::myconfig{dateformat};
 
-  return $self->render(
+  return $self->presenter->render(
     'layout/javascript_setup',
-    { type => 'js', output => 0, },
+    { type => 'js' },
     datefmt      => $datefmt,
     focus        => $::request->layout->focus,
     ajax_spinner => 1,
index 9c4fdea..a838aee 100644 (file)
@@ -6,7 +6,7 @@ use parent qw(SL::Layout::Base);
 sub pre_content {
   my ($self) = @_;
 
-  $self->SUPER::render('menu/header', { output => 0 },
+  $self->presenter->render('menu/header',
                 now        => DateTime->now_local,
                 is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i),
                 is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i));
index 9d5e37d..03c6f3e 100644 (file)
@@ -164,7 +164,7 @@ sub render {
   $callback               = URI->new($callback)->rel($callback) if $callback;
   $callback               = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
 
-  $self->SUPER::render('menu/menuv3', { output => 0 },
+  $self->presenter->render('menu/menuv3',
     force_ul_width => 1,
     date           => $self->clock_line,
     menu           => $self->print_menu,
index 0f252bb..0a15078 100644 (file)
@@ -7,6 +7,8 @@ use lib 't';
 use Support::TestSetup;
 
 use SL::Presenter;
+use SL::Controller::Base;
+use SL::Layout::Javascript;
 
 no warnings 'uninitialized';