From 2b4d64f05414ddea3b4f2d1062fdb18ebae6acf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 16 Oct 2012 13:37:34 +0200 Subject: [PATCH] leerer layout controller --- SL/Controller/Layout.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 SL/Controller/Layout.pm diff --git a/SL/Controller/Layout.pm b/SL/Controller/Layout.pm new file mode 100644 index 000000000..98c012cbc --- /dev/null +++ b/SL/Controller/Layout.pm @@ -0,0 +1,27 @@ +package SL::Controller::Layout; + +use strict; +use parent qw(SL::Controller::Base); + +use JSON (); + +sub action_empty { + my ($self) = @_; + + if ($::form->{format} eq 'json') { + my $layout = { + pre_content => $::request->{layout}->pre_content, + start_content => $::request->{layout}->start_content, + end_content => $::request->{layout}->end_content, + post_content => $::request->{layout}->post_content, + javascripts => [ $::request->{layout}->javascripts ], + javascripts_inline => [ $::request->{layout}->javascripts_inline ], + stylesheets => [ $::request->{layout}->stylesheets ], + stylesheets_inline => [ $::request->{layout}->stylesheets_inline ], + }; + + $self->render(\ JSON::to_json($layout), { type => 'js', raw => 1 }); + } +} + +1; -- 2.20.1