Lines 112-124
Returns a reference to an array of hashes:
Link Here
|
112 |
sub getTranslatedLanguages { |
112 |
sub getTranslatedLanguages { |
113 |
my ($interface, $theme, $current_language, $which) = @_; |
113 |
my ($interface, $theme, $current_language, $which) = @_; |
114 |
my @languages; |
114 |
my @languages; |
|
|
115 |
my $cache_key = ""; |
115 |
my @enabled_languages = |
116 |
my @enabled_languages = |
116 |
( $interface && $interface eq 'intranet' ) |
117 |
( $interface && $interface eq 'intranet' ) |
117 |
? split ",", C4::Context->preference('language') |
118 |
? split ",", C4::Context->preference('language') |
118 |
: split ",", C4::Context->preference('OPACLanguages'); |
119 |
: split ",", C4::Context->preference('OPACLanguages'); |
119 |
|
120 |
|
120 |
my $cache = Koha::Caches->get_instance; |
121 |
my $cache = Koha::Caches->get_instance; |
121 |
my $cache_key = "languages_${interface}_${theme}"; |
122 |
if( defined $interface && defined $theme ){ |
|
|
123 |
$cache_key = "languages_${interface}_${theme}"; |
124 |
} |
122 |
if ($interface && $interface eq 'opac' ) { |
125 |
if ($interface && $interface eq 'opac' ) { |
123 |
my $htdocs = C4::Context->config('opachtdocs'); |
126 |
my $htdocs = C4::Context->config('opachtdocs'); |
124 |
my $cached = $cache->get_from_cache($cache_key); |
127 |
my $cached = $cache->get_from_cache($cache_key); |
125 |
- |
|
|