Revision 2b4d64f0
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
SL/Controller/Layout.pm | ||
---|---|---|
1 |
package SL::Controller::Layout; |
|
2 |
|
|
3 |
use strict; |
|
4 |
use parent qw(SL::Controller::Base); |
|
5 |
|
|
6 |
use 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(\ JSON::to_json($layout), { type => 'js', raw => 1 }); |
|
24 |
} |
|
25 |
} |
|
26 |
|
|
27 |
1; |
Auch abrufbar als: Unified diff
leerer layout controller