X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLayout%2FBase.pm;h=cd5ace9391fc43637f8b6c121da187643954e115;hb=55af6244bd721f294ff5eee7e9357a3217318e5e;hp=1d31a82280e14505ecee68cd0ebe0eda7c754787;hpb=2bed2abd309ca9c6a4e86848a994897449e10819;p=kivitendo-erp.git diff --git a/SL/Layout/Base.pm b/SL/Layout/Base.pm index 1d31a8228..cd5ace939 100644 --- a/SL/Layout/Base.pm +++ b/SL/Layout/Base.pm @@ -11,8 +11,8 @@ use Rose::Object::MakeMethods::Generic ( 'array' => [ 'add_stylesheets_inline' => { interface => 'add', hash_key => 'stylesheets_inline' }, 'add_javascripts_inline' => { interface => 'add', hash_key => 'javascripts_inline' }, - 'sub_layouts', - 'add_sub_layouts' => { interface => 'add', hash_key => 'sub_layouts' }, + 'sub_layouts', => { interface => 'get_set_init' }, + 'add_sub_layouts' => { interface => 'add', hash_key => 'sub_layouts' }, ], ); @@ -60,11 +60,17 @@ sub javascripts_inline { @{ $_[0]->{javascripts_inline} || [] }; } +sub init_sub_layouts { [] } + ######################################### # Interface ######################################## +sub add_stylesheets { + &use_stylesheet; +} + sub use_stylesheet { my $self = shift; push @{ $self->{stylesheets} ||= [] }, @_ if @_; @@ -95,16 +101,19 @@ sub get_stylesheet_for_user { -f "$css_path/$user_style/main.css") { $css_path = "$css_path/$user_style"; } else { - $css_path = "$css_path/lx-office-erp"; + $css_path = "$css_path/kivitendo"; } } else { - $css_path = "$css_path/lx-office-erp"; + $css_path = "$css_path/kivitendo"; } $::myconfig{css_path} = $css_path; # needed for menunew, FIXME: don't do this here return $css_path; } +sub add_javascripts { + &use_javascript +} sub use_javascript { my $self = shift; @@ -116,7 +125,7 @@ sub javascripts { my ($self) = @_; return uniq map { $self->_find_javascript($_) } - $self->use_javascript, map { $_->javascripts } $self->sub_layouts; + map({ $_->javascripts } $self->sub_layouts), $self->use_javascript; } sub _find_javascript {