From b0dc874d4b6c438f8f77fad27db14c2bbe66aecf Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sat, 10 Nov 2007 08:24:56 -0600 Subject: [PATCH] Switching Languages.pm to EXPORT_OK -- don't export all functions by default. Adding languages_loop to all templates Signed-off-by: Joshua Ferraro --- C4/Languages.pm | 15 ++++++--------- C4/Output.pm | 6 +++++- catalogue/search.pl | 5 +---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index 448f47b71f..c1dd28b138 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -22,7 +22,7 @@ package C4::Languages; use strict; use warnings; #FIXME: turn off warnings before release require Exporter; use C4::Context; -use vars qw($VERSION @ISA @EXPORT); +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); =head1 NAME @@ -37,14 +37,9 @@ use C4::Languages; =head1 FUNCTIONS =cut - -@ISA = qw(Exporter); -@EXPORT = qw( - &getFrameworkLanguages - &getTranslatedLanguages - &getAllLanguages - ); - +$VERSION = 3.00; +@ISA = qw(Exporter); +@EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages); my $DEBUG = 0; =head2 getFrameworkLanguages @@ -166,6 +161,7 @@ sub getAllLanguages { language_name => "العربية", language_locale_name => "Arabic", + bidi => "rtl", , }, { @@ -234,6 +230,7 @@ sub getAllLanguages { language_code => "heb", language_name => "עברית", language_locale_name => "Hebrew", + bidi => "rtl", , }, { diff --git a/C4/Output.pm b/C4/Output.pm index aed50ec233..c588e14099 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -29,8 +29,9 @@ use strict; require Exporter; use C4::Context; -use HTML::Template::Pro; +use C4::Languages qw(getTranslatedLanguages); +use HTML::Template::Pro; use vars qw($VERSION @ISA @EXPORT); # set the version for version checking @@ -99,6 +100,9 @@ sub gettemplate { lang => $lang ); + # load the languages ( for switching from one template to another ) + $template->param(languages_loop => getTranslatedLanguages($interface,$theme)); + return $template; } diff --git a/catalogue/search.pl b/catalogue/search.pl index 16dbbaafb2..ece25c01da 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -144,7 +144,7 @@ use C4::Context; use C4::Output; use C4::Auth; use C4::Search; -use C4::Languages; # getAllLanguages +use C4::Languages qw(getAllLanguages); use C4::Koha; use POSIX qw(ceil floor); use C4::Branch; # GetBranches @@ -239,9 +239,6 @@ $template->param(itemtypeloop => \@itemtypesloop); # my ($ccodecount,@ccode_loop) = GetCcodes(); # $template->param(ccodeloop=>\@ccode_loop,); -# load the languages ( for switching from one template to another ) -$template->param(languages_loop => getTranslatedLanguages('intranet','prog')); - # The following should only be loaded if we're bringing up the advanced search template if ( $template_type eq 'advsearch' ) { -- 2.20.1