BugFixing : default language was always en. Not a problem for dev purpose but would...
authorHenri-Damien LAURENT <henridamien@koha-fr.org>
Wed, 16 Jan 2008 18:32:23 +0000 (12:32 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 18 Jan 2008 03:01:03 +0000 (21:01 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Output.pm

index 2645b41..733384f 100644 (file)
@@ -132,28 +132,25 @@ sub themelanguage {
     # But, if there's a cookie set, obey it
     $lang = $query->cookie('KohaOpacLanguage') if $query->cookie('KohaOpacLanguage');
     # Fall back to English
-    $lang = 'en' unless $lang;
+    my @languages = split " ", C4::Context->preference("opaclanguages");
+    if ($lang){  
+        @languages=($lang,@languages);
+    } else {
+        $lang = $languages[0];
+    }      
     my $theme = 'prog';
 
     my $dbh = C4::Context->dbh;
     my @languages;
     my @themes;
     if ( $interface eq "intranet" ) {
-        @languages = split " ", C4::Context->preference("opaclanguages");
         @themes    = split " ", C4::Context->preference("template");
-        @languages = ($lang,@languages) if $lang;
     }
     else {
       # we are in the opac here, what im trying to do is let the individual user
       # set the theme they want to use.
       # and perhaps the them as well.
         #my $lang = $query->cookie('KohaOpacLanguage');
-        if ($lang) {                        # FIXME: if $lang always TRUE!
-            push @languages, $lang;
-        }
-        else {
-            @languages = split " ", C4::Context->preference("opaclanguages");
-        }
         @themes = split " ", C4::Context->preference("opacthemes");
     }