From 6df470c3418fe5d18402b7890c3c148846a6545b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Dec 2010 13:51:56 +0100 Subject: [PATCH] Funktion zur Ausgabe von Stylesheet-Links Conflicts: SL/Template/Plugin/L.pm --- SL/Template/Plugin/L.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 34eb730d1..205363343 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -238,6 +238,20 @@ sub javascript { return $self->html_tag('script', $data, type => 'text/javascript'); } +sub stylesheet_tag { + my $self = shift; + my $code = ''; + + foreach my $file (@_) { + $file .= '.css' unless $file =~ m/\.css$/; + $file = "css/${file}" unless $file =~ m|/|; + + $code .= qq||; + } + + return $code; +} + sub date_tag { my ($self, $name, $value, @slurp) = @_; my %params = _hashify(@slurp); @@ -486,6 +500,13 @@ tag for each file name parameter passed. Each file name will be postfixed with '.js' if it isn't already and prefixed with 'js/' if it doesn't contain a slash. +=item C + +Creates a HTML 'Elink rel="text/stylesheet" href="..."E' tag +for each file name parameter passed. Each file name will be postfixed +with '.css' if it isn't already and prefixed with 'css/' if it doesn't +contain a slash. + =item C $align_code, %attributes> Creates a date input field, with an attached javascript that will open a -- 2.20.1