|
Line 0
Link Here
|
|
|
1 |
package Koha::Util::FrameworkPlugin; |
| 2 |
|
| 3 |
# Module contains subroutines used in the framework plugins |
| 4 |
# |
| 5 |
# Copyright 2014 Koha Development Team |
| 6 |
# |
| 7 |
# This file is part of Koha. |
| 8 |
# |
| 9 |
# Koha is free software; you can redistribute it and/or modify it under the |
| 10 |
# terms of the GNU General Public License as published by the Free Software |
| 11 |
# Foundation; either version 3 of the License, or (at your option) any later |
| 12 |
# version. |
| 13 |
# |
| 14 |
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY |
| 15 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 16 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 17 |
# |
| 18 |
# You should have received a copy of the GNU General Public License along |
| 19 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
| 20 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 |
# |
| 22 |
|
| 23 |
use Modern::Perl; |
| 24 |
|
| 25 |
our ( @ISA, @EXPORT, @EXPORT_OK ); |
| 26 |
BEGIN { |
| 27 |
require Exporter; |
| 28 |
@ISA = qw( Exporter ); |
| 29 |
@EXPORT = qw( ); |
| 30 |
@EXPORT_OK = qw( wrapper ); |
| 31 |
} |
| 32 |
|
| 33 |
=head1 NAME |
| 34 |
|
| 35 |
Koha::Util::Plugin - utility class with routines for framework plugins |
| 36 |
|
| 37 |
=head1 FUNCTIONS |
| 38 |
|
| 39 |
=head2 wrapper |
| 40 |
|
| 41 |
wrapper returns a text for strings containing spaces, pipe chars, ... |
| 42 |
The wrapper subroutine is used in several UNIMARC plugins. |
| 43 |
|
| 44 |
=cut |
| 45 |
|
| 46 |
sub wrapper { |
| 47 |
my ( $str ) = @_; |
| 48 |
return "space" if $str eq " "; |
| 49 |
return "dblspace" if $str eq " "; |
| 50 |
return "pipe" if $str eq "|"; |
| 51 |
return "dblpipe" if $str eq "||"; |
| 52 |
return $str; |
| 53 |
} |
| 54 |
|
| 55 |
1; |