From 1b7d2ea5588460a61fd46618c6fd9c0813b5d203 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Fri, 20 Jun 2008 14:30:31 -0500 Subject: [PATCH] fix for 2257: OPAC news does not display if more than one language is checked in opaclanguages pref --- opac/opac-main.pl | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/opac/opac-main.pl b/opac/opac-main.pl index e7b5ec3354..d72e55b1b6 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -22,7 +22,6 @@ use CGI; use C4::Auth; # get_template_and_user use C4::Output; use C4::VirtualShelves; -use C4::Languages qw/getTranslatedLanguages/; use C4::Branch; # GetBranches use C4::Members; # GetMember use C4::NewsChannels; # get_opac_news @@ -42,33 +41,13 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $borrower = GetMember( $borrowernumber, 'borrowernumber' ); -my @languages; -my $counter = 0; -my $langavail = getTranslatedLanguages('opac'); -foreach my $language (@$langavail) { - -# next if $currently_selected_languages->{$language}; -# FIXME: could incorporate language_name and language_locale_name for better display - push @languages, - { language => $language->{'language_code'}, counter => $counter, selected=>($input->cookie('KohaOpacLanguage') ? $language->{'language_code'} eq $input->cookie('KohaOpacLanguage') - : $language->{'language_code'} eq C4::Context->preference('opaclanguages')) }; - $counter++; -} - -# Template params -if ( $counter > 1 ) { - $template->param( languages => \@languages ) - if C4::Context->preference('opaclanguagesdisplay'); -} - $template->param( textmessaging => $borrower->{textmessaging}, ); # display news # 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 $news_lang = $input->cookie('KohaOpacLanguage') || 'en'; my $all_koha_news = &GetNewsToDisplay($news_lang); my $koha_news_count = scalar @$all_koha_news; -- 2.39.5