From 2b28689ae8aa0de4e9b24dfd9c489ad9f6d7e4a6 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Mon, 17 Mar 2008 22:27:38 -0400 Subject: [PATCH] fixing bug 1754: Hide language chooser if only one translation is available Signed-off-by: Joshua Ferraro --- C4/Languages.pm | 3 +++ changelanguage.pl | 2 +- .../intranet-tmpl/prog/en/includes/intranet-bottom.inc | 6 ++++-- koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index bc578f0f141..77bbf498ada 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -254,6 +254,8 @@ sub _build_languages_arrayref { my @translated_languages = @$translated_languages; my @languages_loop; # the final reference to an array of hashrefs my @enabled_languages = @$enabled_languages; + # how many languages are enabled, if one, take note, some contexts won't need to display it + my $one_language_enabled = 1 unless @enabled_languages > 1; my %seen_languages; # the language tags we've seen my %found_languages; my $language_groups; @@ -298,6 +300,7 @@ sub _build_languages_arrayref { plural => $track_language_groups->{$key} >1 ? 1 : 0, current => $current_language_regex->{language} eq $key ? 1 : 0, group_enabled => $enabled, + one_language_enabled => $one_language_enabled, }; } return \@languages_loop; diff --git a/changelanguage.pl b/changelanguage.pl index 9a470aef646..536d0aa8fd2 100755 --- a/changelanguage.pl +++ b/changelanguage.pl @@ -22,5 +22,5 @@ my $language = $query->param('language'); my $url = $query->referer(); -warn "Language : $query // $language // $url"; +#warn "Language : $query // $language // $url"; setlanguagecookie( $query, $language, $url ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc index 8f48a71f534..a6a2b070d38 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -21,14 +21,16 @@ + -
  • ()
  • +
  • -
  • "> ()
  • +
  • ">
  • + diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc index 74ca6fcf8d1..7462e0327da 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -24,6 +24,7 @@ +
  • @@ -32,6 +33,7 @@ +