-function handle_delete()
-{
- global $path_to_root, $installed_languages;
-
- $id = $_GET['id'];
-
- $lang = $installed_languages[$id]['code'];
- $filename = "$path_to_root/lang/$lang/LC_MESSAGES";
- if ($h = opendir($filename))
- {
- while (($file = readdir($h)) !== false)
- {
- if (is_file("$filename/$file"))
- unlink("$filename/$file");
- }
- closedir($h);
- }
- rmdir($filename);
- $filename = "$path_to_root/lang/$lang";
- if ($h = opendir($filename))
- {
- while (($file = readdir($h)) !== false)
- {
- if (is_file("$filename/$file"))
- unlink("$filename/$file");
- }
- closedir($h);
- }
- rmdir($filename);
-
- unset($installed_languages[$id]);
- $conn = array_values($installed_languages);
- $installed_languages = $conn;
-
- //$$db_connections = array_values($db_connections);
-
- if (!write_lang())
- return;
- meta_forward($_SERVER['PHP_SELF']);
-}
-
-//---------------------------------------------------------------------------------------------
-
-function display_languages()
-{
- global $table_style, $installed_languages;
-
- $lang = $_SESSION["language"]->code;
-
- echo "
- <script language='javascript'>
- function deleteLanguage(id) {
- if (!confirm('" . _("Are you sure you want to delete language no. ") . "'+id))
- return
- document.location.replace('inst_lang.php?c=df&id='+id)
- }
- </script>";
- start_table($table_style);
- $th = array(_("Language"), _("Name"), _("Encoding"), _("Right To Left"), "", "");
- table_header($th);
-
- $k = 0;
- $conn = $installed_languages;
- $n = count($conn);
- for ($i = 0; $i < $n; $i++)
- {
- if ($conn[$i]['code'] == $lang)
- start_row("class='stockmankobg'");
- else
- alt_table_row_color($k);
-
- label_cell($conn[$i]['code']);
- label_cell($conn[$i]['name']);
- label_cell($conn[$i]['encoding']);
- if (isset($conn[$i]['rtl']) && $conn[$i]['rtl'])
- $rtl = _("Yes");
- else
- $rtl = _("No");
- label_cell($rtl);
- edit_link_cell("selected_id=" . $i);
- if ($conn[$i]['code'] != $lang)
- label_cell("<a href='javascript:deleteLanguage(" . $i . ")'>" . _("Delete") . "</a>");
- end_row();
- }
-
- end_table();
- display_note(_("The marked language is the current language which cannot be deleted."), 0, 0, "class='currentfg'");
-}
-
-//---------------------------------------------------------------------------------------------
-