X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=8d28f845b869a38afe3348df0669eb9dc06a86a2;hb=ce83fab980b72a2b3d4066ce2b49cbf3feec56a5;hp=529426ec2cd9277b322bb01771b2172cc39970f2;hpb=925da7fb961c7f344658542d97ae2a8b56e5e5f2;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 529426ec2..8d28f845b 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -56,6 +56,7 @@ use SL::DBUtils; use SL::DO; use SL::IC; use SL::IS; +use SL::Locale; use SL::Mailer; use SL::Menu; use SL::MoreCommon qw(uri_encode uri_decode); @@ -459,6 +460,24 @@ sub use_stylesheet { return @{ $self->{stylesheet} }; } +sub get_stylesheet_for_user { + my $css_path = 'css'; + if (my $user_style = $::myconfig{stylesheet}) { + $user_style =~ s/\.css$//; # nuke trailing .css, this is a remnand of pre 2.7.0 stylesheet handling + if (-d "$css_path/$user_style" && + -f "$css_path/$user_style/main.css") { + $css_path = "$css_path/$user_style"; + } else { + $css_path = "$css_path/lx-office-erp"; + } + } else { + $css_path = "$css_path/lx-office-erp"; + } + $::myconfig{css_path} = $css_path; # needed for menunew, FIXME: don't do this here + + return $css_path; +} + sub header { $::lxdebug->enter_sub; @@ -470,6 +489,8 @@ sub header { $::lxdebug->leave_sub and return if !$ENV{HTTP_USER_AGENT} || $self->{header}++; + my $css_path = $self->get_stylesheet_for_user; + $self->{favicon} ||= "favicon.ico"; $self->{titlebar} = "$self->{title} - $self->{titlebar}" if $self->{title}; @@ -480,21 +501,16 @@ sub header { push @header, ""; } - push @header, map { qq|| } $self->use_stylesheet; + push @header, map { qq|| } $self->use_stylesheet; push @header, "" if $self->{landscape}; push @header, "" if -f $self->{favicon}; - push @header, '', - '', - '', - '', - '', - '', - '', - '', - '', - ''; + push @header, map { qq|| } + qw(jquery common jscalendar/calendar jscalendar/lang/calendar-de jscalendar/calendar-setup part_selection jquery-ui jqModal switchmenuframe); push @header, $self->{javascript} if $self->{javascript}; + push @header, map { qq|| } + qw(main menu tabcontent list_accounts jquery.autocomplete jquery.multiselect2side frame_header/header ui-lightness/jquery-ui-1.8.12.custom); + push @header, map { qq|| } push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] }; push @header, "" if $self->{fokus}; push @header, sprintf "", @@ -530,9 +546,7 @@ sub header { EOT print " $_\n" for @header; print < -