Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.2 KiB

  1. package Koha::Template::Plugin::KohaSpan;
  2. # Copyright ByWater Solutions 2016
  3. # Author: Kyle M Hall <kyle@bywatersolutions.com>
  4. # This file is part of Koha.
  5. #
  6. # Koha is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # Koha is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Koha; if not, see <http://www.gnu.org/licenses>.
  18. use Modern::Perl;
  19. use Template::Plugin::Filter;
  20. use base qw( Template::Plugin::Filter );
  21. our $DYNAMIC = 1;
  22. sub filter {
  23. my ( $self, $text, $args, $config ) = @_;
  24. $config->{with_hours} //= 0;
  25. my $id = $config->{id};
  26. my $class = $config->{class};
  27. my $span = "<span";
  28. $span .= " id='$id'" if $id;
  29. $span .= " class='$class'" if $class;
  30. $span .= ">$text</span>";
  31. return $span;
  32. }
  33. 1;