|
264 | 264 | $result_select = Database::query($sql_select);
|
265 | 265 |
|
266 | 266 | $current_access_url = api_get_current_access_url_id();
|
267 |
| -$sql_select_lang = "SELECT * FROM $tbl_settings_current |
268 |
| - WHERE category='Languages' |
269 |
| - AND access_url = $current_access_url"; |
270 |
| - |
271 |
| -$result_select_lang = Database::query($sql_select_lang); |
272 |
| -$row_lang = Database::fetch_array($result_select_lang); |
| 267 | +$platformLanguage = api_get_setting('platformLanguage'); |
273 | 268 |
|
274 | 269 | // the table data
|
275 | 270 | $language_data = [];
|
|
279 | 274 | // the first column is the original name of the language OR a form containing the original name
|
280 | 275 | if ($action == 'edit' and $row['id'] == $_GET['id']) {
|
281 | 276 | $checked = '';
|
282 |
| - if ($row['english_name'] == api_get_setting('platformLanguage')) { |
| 277 | + if ($row['english_name'] == $platformLanguage) { |
283 | 278 | $checked = ' checked="checked" ';
|
284 | 279 | }
|
285 | 280 |
|
|
295 | 290 | // the third column
|
296 | 291 | $row_td[] = $row['dokeos_folder'];
|
297 | 292 |
|
298 |
| - if ($row['english_name'] == $row_lang['selected_value']) { |
| 293 | + if ($row['english_name'] == $platformLanguage) { |
299 | 294 | $setplatformlanguage = Display::return_icon('languages.png', get_lang('CurrentLanguagesPortal'), '', ICON_SIZE_SMALL);
|
300 | 295 | } else {
|
301 | 296 | $setplatformlanguage = "<a href=\"javascript:if (confirm('".addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault'))."')) { location.href='".api_get_self()."?action=setplatformlanguage&id=".$row['id']."'; }\">".Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL)."</a>";
|
|
326 | 321 | $allow_add_term_sub_language = '';
|
327 | 322 | }
|
328 | 323 |
|
329 |
| - if ($row['english_name'] == $row_lang['selected_value']) { |
| 324 | + if ($row['english_name'] == $platformLanguage) { |
330 | 325 | $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>
|
331 | 326 | ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
|
332 | 327 | } else {
|
|
0 commit comments