'') { $sql_update_2 = "UPDATE $tbl_settings_current SET selected_value='{$_POST['platformlanguage']}' WHERE variable='platformLanguage'"; $result_2 = api_sql_query($sql_update_2); } } elseif (isset($_POST['action'])) { switch ($_POST['action']) { case 'makeavailable' : if (count($_POST['id']) > 0) { $ids = array (); foreach ($_POST['id'] as $index => $id) { $ids[] = mysql_real_escape_string($id); } $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('".implode("','", $ids)."')"; api_sql_query($sql,__FILE__,__LINE__); } break; case 'makeunavailable' : if (count($_POST['id']) > 0) { $ids = array (); foreach ($_POST['id'] as $index => $id) { $ids[] = mysql_real_escape_string($id); } $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('".implode("','", $ids)."')"; api_sql_query($sql,__FILE__,__LINE__); } break; } } /* ============================================================================== MAIN CODE ============================================================================== */ // setting the name of the tool $tool_name = get_lang('PlatformLanguages'); // setting breadcrumbs $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); // including the header file (which includes the banner itself) Display :: display_header($tool_name); // displaying the naam of the tool //api_display_tool_title($tool_name); // displaying the explanation for this tool echo '
'.get_lang('PlatformLanguagesExplanation').'
'; // selecting all the languages $sql_select = "SELECT * FROM $tbl_admin_languages"; $result_select = api_sql_query($sql_select); /* -------------------------------------- DISPLAY THE TABLE -------------------------------------- */ // the table data $language_data = array (); while ($row = mysql_fetch_array($result_select)) { $row_td = array (); $row_td[] = $row['id']; // the first column is the original name of the language OR a form containing the original name if ($_GET['action'] == 'edit' and $row['id'] == $_GET['id']) { $row_td[] = ' ' . ' '; } else { $row_td[] = $row['original_name']; } // the second column $row_td[] = $row['english_name']; // the third column $row_td[] = $row['dokeos_folder']; // the fourth column with the visibility icon and the edit icon if ($row['available'] == 1) { $row_td[] = " "; } else { $row_td[] = " "; } $language_data[] = $row_td; } $table = new SortableTableFromArray($language_data, 1, count($language_data)); $table->set_header(0, ''); $table->set_header(1, get_lang('OriginalName')); $table->set_header(2, get_lang('EnglishName')); $table->set_header(3, get_lang('DokeosFolder')); $table->set_header(4, get_lang('Properties')); $form_actions = array (); $form_actions['makeavailable'] = get_lang('MakeAvailable'); $form_actions['makeunavailable'] = get_lang('MakeUnavailable'); $table->set_form_actions($form_actions); $table->display(); /* ============================================================================== FOOTER ============================================================================== */ Display :: display_footer(); ?>