Koha/t/icondirectories.t
Andrew Moore c41da00b4a Bug 2044: allowing multiuple icon sets
I've rearranged the two directories where media type icons live.
I've also added two more collections of icons, one from
http://apps.carleton.edu/campus/library/bridge_icons/
and one from liblime (Tina). The first has a license restriction that I added
to the "Licenses" tab on the "About" page.

Then, I've adjusted the Item Types Administration page so that it can deal
with multiple collections of icons.

I also added a test script to verify that the two identical icon directories
are actually identical.

DOCUMENTATION CHANGE: It's possible that we need to add something to the administration
documentation to indicate how you can add more sets of icons if you want. You simply add
directory to koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/ and to
koha-tmpl/opac-tmpl/prog/itemtypeimg. The icons should start showing up.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-24 11:54:18 -05:00

62 lines
1.1 KiB
Perl

#!/usr/bin/env perl
=head1 NAME
icondirectories.t - test to ensure that the two directories of icons
in the staff and opac interface are identical.
=head1 DESCRIPTION
Tere are two directories of icons for media types, one for the opac
and one for the staff interface. They need to be identical. This
ensures that they are.
=cut
use strict;
use warnings;
use lib qw( .. );
use C4::Koha;
use Data::Dumper;
use File::Find;
use Test::More tests => 1;
my $opac_icon_directory = getitemtypeimagedir();
my $staff_icon_directory = getitemtypeimagedir( 'intranet' );
my $opac_icons; # hashref of filenames to sizes
sub opac_wanted {
my $file = $File::Find::name;
$file =~ s/^$opac_icon_directory//;
$opac_icons->{ $file } = -s $_;
}
find( \&opac_wanted, $opac_icon_directory );
my $staff_icons; # hashref of filenames to sizes
sub staff_wanted {
my $file = $File::Find::name;
$file =~ s/^$staff_icon_directory//;
$staff_icons->{ $file } = -s $_;
}
find( \&staff_wanted, $staff_icon_directory );
is_deeply( $opac_icons, $staff_icons )
or diag( Data::Dumper->Dump( [ $opac_icons ], [ 'opac_icons' ] ) );