From: Moritz Bunkus Date: Mon, 27 Dec 2010 12:43:40 +0000 (+0100) Subject: Layout-Helfer für JavaScript-Src-Tags X-Git-Tag: release-2.6.2beta1~64^2~36 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=62ba378c53a7ead8c5e99ef965d79d7368216b88;p=kivitendo-erp.git Layout-Helfer für JavaScript-Src-Tags Conflicts: SL/Template/Plugin/L.pm --- diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 710f1c923..d9fd3c1f5 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -203,6 +203,19 @@ sub date_tag { $self->javascript( "Calendar.setup({ inputField: '$name_e', ifFormat: '$::myconfig{jsc_dateformat}', align: '$params{cal_align}', button: 'trigger$seq' });" ) : ''); + +sub javascript_tag { + my $self = shift; + my $code = ''; + + foreach my $file (@_) { + $file .= '.js' unless $file =~ m/\.js$/; + $file = "js/${file}" unless $file =~ m|/|; + + $code .= qq||; + } + + return $code; } 1; @@ -310,6 +323,13 @@ If C<%attributes> contains a key C