Revision 2bed2abd
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
SL/Layout/Base.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
use parent qw(SL::Controller::Base); |
5 | 5 |
|
6 |
use List::MoreUtils qw(uniq); |
|
7 |
|
|
6 | 8 |
use Rose::Object::MakeMethods::Generic ( |
7 | 9 |
'scalar --get_set_init' => qw(menu), |
8 | 10 |
'scalar' => qw(focus), |
... | ... | |
49 | 51 |
} |
50 | 52 |
|
51 | 53 |
sub stylesheets_inline { |
52 |
( map { $_->stylesheets_inline } $_[0]->sub_layouts ), |
|
54 |
uniq ( map { $_->stylesheets_inline } $_[0]->sub_layouts ),
|
|
53 | 55 |
@{ $_[0]->{stylesheets_inline} || [] }; |
54 | 56 |
} |
55 | 57 |
|
56 | 58 |
sub javascripts_inline { |
57 |
( map { $_->javascripts_inline } $_[0]->sub_layouts ), |
|
59 |
uniq ( map { $_->javascripts_inline } $_[0]->sub_layouts ),
|
|
58 | 60 |
@{ $_[0]->{javascripts_inline} || [] }; |
59 | 61 |
} |
60 | 62 |
|
... | ... | |
73 | 75 |
my ($self) = @_; |
74 | 76 |
my $css_path = $self->get_stylesheet_for_user; |
75 | 77 |
|
76 |
return grep { $_ } map { $self->_find_stylesheet($_, $css_path) } |
|
78 |
return uniq grep { $_ } map { $self->_find_stylesheet($_, $css_path) }
|
|
77 | 79 |
$self->use_stylesheet, map { $_->stylesheets } $self->sub_layouts; |
78 | 80 |
} |
79 | 81 |
|
... | ... | |
113 | 115 |
sub javascripts { |
114 | 116 |
my ($self) = @_; |
115 | 117 |
|
116 |
return map { $self->_find_javascript($_) } |
|
118 |
return uniq map { $self->_find_javascript($_) }
|
|
117 | 119 |
$self->use_javascript, map { $_->javascripts } $self->sub_layouts; |
118 | 120 |
} |
119 | 121 |
|
Auch abrufbar als: Unified diff
css und js includes in layouts sollten unique sein.