use strict;
use C4::Context;
use C4::Output;
+use URI::Split qw(uri_split);
use vars qw($VERSION @ISA @EXPORT $DEBUG);
&getFacets
&displayServers
&getnbpages
- &getitemtypeimagesrcfromurl
&get_infos_of
&get_notforloan_label_of
&getitemtypeimagedir
&getitemtypeimagesrc
+ &getitemtypeimagelocation
&GetAuthorisedValues
&GetAuthorisedValueCategories
&GetKohaAuthorisedValues
=head1 FUNCTIONS
-=over 2
-
=cut
+
=head2 slashifyDate
$slash_date = &slashifyDate($dash_date);
$sth->execute($itemtype);
my $res = $sth->fetchrow_hashref;
- $res->{imageurl} = getitemtypeimagesrcfromurl( $res->{imageurl} );
+ $res->{imageurl} = getitemtypeimagelocation( 'intranet', $res->{imageurl} );
return $res;
}
-sub getitemtypeimagesrcfromurl {
- my ($imageurl) = @_;
-
- if ( defined $imageurl and $imageurl !~ m/^http/ ) {
- $imageurl = getitemtypeimagesrc() . '/' . $imageurl;
- }
-
- return $imageurl;
-}
-
=head2 getitemtypeimagedir
=over
}
}
+sub getitemtypeimagelocation($$) {
+ my ( $src, $image ) = @_;
+
+ return '' if ( !$image );
+
+ my $scheme = ( uri_split( $image ) )[0];
+
+ return $image if ( $scheme );
+
+ return getitemtypeimagesrc( $src ) . '/' . $image;
+}
+
=head3 _getImagesFromDirectory
Find all of the image files in a directory in the filesystem
return $printer;
}
-=item getnbpages
+=head2 getnbpages
Returns the number of pages to display in a pagination bar, given the number
of items and the number of items per page.
return int( ( $nb_items - 1 ) / $nb_items_per_page ) + 1;
}
-=item getallthemes
+=head2 getallthemes
(@themes) = &getallthemes('opac');
(@themes) = &getallthemes('intranet');