use Template::Plugin;
use base qw( Template::Plugin );
-use File::Basename;
+use File::Basename qw( fileparse );
use File::Spec;
use C4::Context;
+use Koha;
=head1 FUNCTIONS
$attributes->{src} = $url;
- return $self->tag('script', $attributes) . '</script>';
+ return $self->_tag('script', $attributes) . '</script>';
}
=head2 css
$attributes->{type} = 'text/css';
$attributes->{href} = $url;
- return $self->tag('link', $attributes);
+ return $self->_tag('link', $attributes);
}
=head2 url
".",
);
- my $version = C4::Context->preference('Version');
+ my $version = Koha::version;
+ $version =~ s/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/$1.$2$3$4/;
foreach my $dir (@dirs) {
my $abspath = File::Spec->catfile($root, $dir, $filename);
if (-e $abspath) {
}
}
-=head2 tag
+=head2 _tag
Returns an HTML tag with given name and attributes.
This shouldn't be used directly.
- [% Asset.tag("script", { src = "/koha-tmpl/intranet-tmpl/prog/css/datatables.css" }) %]
-
=cut
-sub tag {
+sub _tag {
my ($self, $name, $attributes) = @_;
my @attributes_strs;