d5d0988f3e1ac6e480f29a630a2000151cd92279
[kivitendo-erp.git] / SL / Controller / Layout.pm
1 package SL::Controller::Layout;
2
3 use strict;
4 use parent qw(SL::Controller::Base);
5
6 use SL::JSON ();
7
8 sub action_empty {
9   my ($self) = @_;
10
11   if ($::form->{format} eq 'json') {
12     my $layout = {
13       pre_content        => $::request->{layout}->pre_content,
14       start_content      => $::request->{layout}->start_content,
15       end_content        => $::request->{layout}->end_content,
16       post_content       => $::request->{layout}->post_content,
17       javascripts        => [ $::request->{layout}->javascripts ],
18       javascripts_inline => [ $::request->{layout}->javascripts_inline ],
19       stylesheets        => [ $::request->{layout}->stylesheets ],
20       stylesheets_inline => [ $::request->{layout}->stylesheets_inline ],
21     };
22
23     $self->render(\ SL::JSON::to_json($layout), { type => 'json', process => 0 });
24   }
25 }
26
27 1;