kivitendo/SL/Controller/Layout.pm @ 2651b9cb
2b4d64f0 | Sven Schöling | package SL::Controller::Layout;
|
||
use strict;
|
||||
use parent qw(SL::Controller::Base);
|
||||
7647d46a | Moritz Bunkus | use SL::JSON ();
|
||
2b4d64f0 | Sven Schöling | |||
sub action_empty {
|
||||
my ($self) = @_;
|
||||
98e679e3 | Sven Schöling | if ($::form->{format} eq 'json' || $::request->type eq 'json') {
|
||
2b4d64f0 | Sven Schöling | 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 ],
|
||||
};
|
||||
7647d46a | Moritz Bunkus | $self->render(\ SL::JSON::to_json($layout), { type => 'json', process => 0 });
|
||
98e679e3 | Sven Schöling | } else {
|
||
$self->render(\'', { process => 0 });
|
||||
2b4d64f0 | Sven Schöling | }
|
||
}
|
||||
1;
|