[Koha-cvs] koha/opac opac-main.pl [rel_3_0]

Joshua Ferraro jmf at liblime.com
Tue Feb 20 07:21:18 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Joshua Ferraro <kados>	07/02/20 06:21:18

Modified files:
	opac           : opac-main.pl 

Log message:
	update to use getTranslatedLanguages instead of GetLanguages
	also updated call to GetNewsToDisplay to pick the language in the cookie and default
	to the systempref if cookie isn't set

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-main.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.23.2.10&r2=1.23.2.11

Patches:
Index: opac-main.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-main.pl,v
retrieving revision 1.23.2.10
retrieving revision 1.23.2.11
diff -u -b -r1.23.2.10 -r1.23.2.11
--- opac-main.pl	5 Feb 2007 18:33:30 -0000	1.23.2.10
+++ opac-main.pl	20 Feb 2007 06:21:18 -0000	1.23.2.11
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: opac-main.pl,v 1.23.2.10 2007/02/05 18:33:30 toins Exp $
+# $Id: opac-main.pl,v 1.23.2.11 2007/02/20 06:21:18 kados Exp $
 
 use strict;
 require Exporter;
@@ -23,7 +23,7 @@
 use C4::Auth;    # get_template_and_user
 use C4::Interface::CGI::Output;
 use C4::BookShelves;
-use C4::Koha;           # GetLanguages
+use C4::Languages;           # getTranslatedLanguages
 use C4::Branch;         # GetBranches
 use C4::Members;        # GetMember
 use C4::NewsChannels;   # get_opac_news
@@ -71,9 +71,10 @@
 my $borrower = GetMember( '', $borrowernumber );
 my @languages;
 my $counter = 0;
-foreach my $language ( GetLanguages() ) {
+foreach my $language ( getTranslatedLanguages('opac') ) {
     #   next if $currently_selected_languages->{$language};
-    push @languages, { language => $language, counter => $counter };
+	#   FIXME: could incorporate language_name and language_locale_name for better display
+    push @languages, { language => $language->{'language_code'}, counter => $counter };
     $counter++;
 }
 
@@ -89,7 +90,9 @@
 );
 
 # display news
-my  $all_koha_news  = &GetNewsToDisplay( &GetLanguages("opac") );
+# use cookie setting for language, bug default to syspref if it's not set
+my $news_lang = $input->cookie('KohaOpacLanguage') || C4::Context->preference('opaclanguages');
+my  $all_koha_news  = &GetNewsToDisplay( $news_lang );
 my $koha_news_count = scalar @$all_koha_news;
 
 $template->param(





More information about the Koha-cvs mailing list