Bug 17600: Standardize our EXPORT_OK
[srvgit] / Koha / Illrequest / Config.pm
index 617de7d..82b7768 100644 (file)
@@ -4,22 +4,22 @@ package Koha::Illrequest::Config;
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 3 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
 
-use File::Basename qw/basename/;
+use File::Basename qw( basename );
 
 use C4::Context;
 
@@ -104,20 +104,25 @@ sub backend_dir {
 
 =head3 available_backends
 
-Return a list of available backends.
+  $backends = $config->available_backends;
+  $backends = $config->abailable_backends($reduced);
+
+Return a list of available backends, if passed a | delimited list it
+will filter those backends down to only those present in the list.
 
 =cut
 
 sub available_backends {
-    my ( $self ) = @_;
+    my ( $self, $reduce ) = @_;
     my $backend_dir = $self->backend_dir;
     my @backends = ();
     @backends = glob "$backend_dir/*" if ( $backend_dir );
     @backends = map { basename($_) } @backends;
+    @backends = grep { $_ =~ /$reduce/ } @backends if $reduce;
     return \@backends;
 }
 
-=head has_branch
+=head3 has_branch
 
 Return whether a 'branch' block is defined