Lines 166-195
sub GetPrefParams {
Link Here
|
166 |
$counter++; |
166 |
$counter++; |
167 |
} |
167 |
} |
168 |
} elsif ( $data->{'type'} eq 'Languages' ) { |
168 |
} elsif ( $data->{'type'} eq 'Languages' ) { |
169 |
my $currently_selected_languages; |
169 |
my $interface = $data->{'variable'} =~ /opac/i ? 'opac' : 'intranet'; |
170 |
foreach my $language ( split /\s+/, $data->{'value'} ) { |
170 |
my $theme = C4::Context->preference( $interface eq 'opac' ? 'opacthemes' : 'template' ); |
171 |
$currently_selected_languages->{$language} = 1; |
171 |
$params->{'languages_loop'} = getTranslatedLanguages( $interface, $theme ); |
172 |
} |
|
|
173 |
|
174 |
# current language |
175 |
my $lang = $params->{'lang'}; |
176 |
my $theme; |
177 |
my $interface; |
178 |
if ( $data->{'variable'} =~ /opac/ ) { |
179 |
|
180 |
# this is the OPAC |
181 |
$interface = 'opac'; |
182 |
$theme = C4::Context->preference('opacthemes'); |
183 |
} else { |
184 |
|
185 |
# this is the staff interface |
186 |
$interface = 'intranet'; |
187 |
$theme = C4::Context->preference('template'); |
188 |
} |
189 |
my $languages_loop = getTranslatedLanguages( $interface, $theme, $lang, $currently_selected_languages ); |
190 |
|
191 |
$params->{'languages_loop'} = $languages_loop; |
192 |
$params->{'type_langselector'} = 1; |
172 |
$params->{'type_langselector'} = 1; |
|
|
173 |
#FIXME Bug 29251: Make sure that current selection is checked (within borders of enabled) |
193 |
} else { |
174 |
} else { |
194 |
$params->{'type_free'} = 1; |
175 |
$params->{'type_free'} = 1; |
195 |
$params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 ) ? $data->{'options'} : 30; |
176 |
$params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 ) ? $data->{'options'} : 30; |