leerer layout controller
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 16 Oct 2012 11:37:34 +0000 (13:37 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 17 Oct 2012 14:03:30 +0000 (16:03 +0200)
SL/Controller/Layout.pm [new file with mode: 0644]

diff --git a/SL/Controller/Layout.pm b/SL/Controller/Layout.pm
new file mode 100644 (file)
index 0000000..98c012c
--- /dev/null
@@ -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;