Bug 42727: Sort using the order from the staff syspref
The main goal of the previous patch was to prevent the randomness, the languages were displayed by code. The languages in the footer are the languages enabled for the staff interface. This patch suggests to use the order of the syspref, and append the languages not enabled at the end of the list. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
a098d97b5a
commit
6e162e4c10
|
|
@ -34,7 +34,7 @@ BEGIN {
|
|||
|
||||
use Carp qw( carp );
|
||||
use CGI;
|
||||
use List::MoreUtils qw( any );
|
||||
use List::MoreUtils qw( any uniq );
|
||||
use C4::Context;
|
||||
use Koha::Caches;
|
||||
use Koha::Cache::Memory::Lite;
|
||||
|
|
@ -123,6 +123,10 @@ sub getTranslatedLanguages {
|
|||
} elsif ( $interface eq 'opac' ) {
|
||||
@enabled_languages = split ",", C4::Context->preference('OPACLanguages');
|
||||
}
|
||||
} else {
|
||||
@enabled_languages = split ",",
|
||||
join( ',', C4::Context->preference( 'StaffInterfaceLanguages', C4::Context->preference('OPACLanguages') ) );
|
||||
@enabled_languages = uniq @enabled_languages;
|
||||
}
|
||||
|
||||
my $cache = Koha::Caches->get_instance;
|
||||
|
|
@ -152,9 +156,7 @@ sub getTranslatedLanguages {
|
|||
$htdocs = C4::Context->config('opachtdocs');
|
||||
push @languages, _get_opac_language_dirs($htdocs);
|
||||
|
||||
my %seen;
|
||||
$seen{$_}++ for @languages;
|
||||
@languages = keys %seen;
|
||||
@languages = uniq @languages;
|
||||
}
|
||||
return _build_languages_arrayref( \@languages, $current_language, \@enabled_languages );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue