X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b11e580342078c2b1537ccfb714f0b27ae044a0f..6fb7bcc9f1e00bc068a4514a3c7fa599119e6e06:/SL/Form.pm?ds=inline
diff --git a/SL/Form.pm b/SL/Form.pm
index dfff9b4f7..cef5995ab 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -640,6 +640,18 @@ sub create_http_response {
return $output;
}
+sub use_stylesheet {
+ my $self = shift;
+
+ $self->{stylesheet} = [ $self->{stylesheet} ] unless ref $self->{stylesheet} eq 'ARRAY';
+ $self->{stylesheet} = [ grep { -f }
+ map { m:^css/: ? $_ : "css/$_" }
+ grep { $_ }
+ (@{ $self->{stylesheet} }, @_)
+ ];
+
+ return @{ $self->{stylesheet} };
+}
sub header {
$::lxdebug->enter_sub;
@@ -662,8 +674,7 @@ sub header {
push @header, "";
}
- push @header, ""
- for grep { -f "css/$_" } apply { s|.*/|| } $self->{stylesheet}, $self->{stylesheets};
+ push @header, map { qq|| } $self->use_stylesheet;
push @header, "" if $self->{landscape};
push @header, "" if -f $self->{favicon};
@@ -1638,7 +1649,7 @@ sub date_closed {
# Leere Datumseingabe i.O.
# SELECT 1 FROM defaults WHERE '' < closedto
# normale Zahlungsbuchung über Rechnungsmaske i.O.
- # SELECT 1 FROM defaults WHERE '10.05.2011' < closedto
+ # SELECT 1 FROM defaults WHERE '10.05.2011' < closedto
# Testfälle mit definiertem closedto (30.04.2011):
# Leere Datumseingabe i.O.
# SELECT 1 FROM defaults WHERE '' < closedto
@@ -3812,7 +3823,7 @@ Examples:
=head2 C
Generates a general purpose http/html header and includes most of the scripts
-ans stylesheets needed.
+and stylesheets needed. Stylesheets can be added with L.
Only one header will be generated. If the method was already called in this
request it will not output anything and return undef. Also if no
@@ -3832,9 +3843,8 @@ default to 3 seconds and the refering url.
=item stylesheet
-=item stylesheets
-
-If these are arrayrefs the contents will be inlined into the header.
+Either a scalar or an array ref. Will be inlined into the header. Add
+stylesheets with the L function.
=item landscape