From 54ebc1cf4fd8524114cb580cae86d8921df0e55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 14 Apr 2003 13:17:18 +0000 Subject: [PATCH] Display choice for charset also when only UploadDir available. --- ChangeLog | 2 ++ db_details.php3 | 45 ++++++++++++++++++++++++++------------------- tbl_query_box.php3 | 45 ++++++++++++++++++++++++++------------------- 3 files changed, 54 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b7dfbbb0..7dc14ed60 100755 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ $Source$ * footer.inc.php3: Fixed for quotes, HTML entities and other weird characters in db/table name. * libraries/display_tbl.lib.php3: Fixed bug #720672 - moved headers. + * db_details.php3, tbl_query_box.php3: Display choice for charset also + when only UploadDir available. 2003-04-14 Garvin Hicking * libraries/common.lib.php3: Fixed SHOW TABLE STATUS LIKE ... FROM ... diff --git a/db_details.php3 b/db_details.php3 index c5aa5e36a..62773b365 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -75,24 +75,6 @@ if ($is_upload) {

' . "\n" - . ' ' . "\n"; - while ($temp_charset = next($cfg['AvailableCharsets'])) { - echo ' ' . "\n"; - } - echo '
' . "\n" . ' '; - } // end if (recoding) $is_gzip = ($cfg['GZipDump'] && @function_exists('gzopen')); $is_bzip = ($cfg['BZipDump'] && @function_exists('bzdecompress')); if ($is_bzip || $is_gzip) { @@ -119,14 +101,15 @@ if ($is_upload) { echo "\n"; // web-server upload directory -// (TODO: display the charset selection, even if is_upload == FALSE) +$is_upload_dir = false; if ($cfg['UploadDir'] != '') { if ($handle = @opendir($cfg['UploadDir'])) { $is_first = 0; while ($file = @readdir($handle)) { if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') { if ($is_first == 0) { + $is_upload_dir = true; echo "\n"; echo ' ' . $strOr . ' ' . $strWebServerUploadDirectory . ' :
' . "\n"; echo '
' . "\n"; @@ -151,6 +134,30 @@ if ($cfg['UploadDir'] != '') { } } // end if (web-server upload directory) +// Charset conversion options +if ($is_upload || $is_upload_dir) { + if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) { + echo '
' . "\n"; + $temp_charset = reset($cfg['AvailableCharsets']); + echo $strCharsetOfFile . "\n" + . '
' . "\n" . ' '; + echo '
' . "\n"; + } // end if (recoding) +} + // Bookmark Support if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) { if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) { diff --git a/tbl_query_box.php3 b/tbl_query_box.php3 index 65e1b703c..673bc2a3e 100755 --- a/tbl_query_box.php3 +++ b/tbl_query_box.php3 @@ -137,24 +137,6 @@ if ($is_upload && (!isset($is_inside_querywindow) ||

' . "\n" - . ' ' . "\n"; - while ($temp_charset = next($cfg['AvailableCharsets'])) { - echo ' ' . "\n"; - } // end while - echo '
' . "\n" . ' '; - } // end if $is_gzip = ($cfg['GZipDump'] && @function_exists('gzopen')); $is_bzip = ($cfg['BZipDump'] && @function_exists('bzdecompress')); if ($is_bzip || $is_gzip) { @@ -187,7 +169,7 @@ if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($qu } // web-server upload directory -// (TODO: display the charset selection, even if is_upload == FALSE) +$is_upload_dir = false; if ($cfg['UploadDir'] != '' && !isset($is_inside_querywindow) || ($cfg['UploadDir'] != '' && isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'files' || $querydisplay_tab == 'full')) && isset($db) && $db != '') { @@ -196,6 +178,7 @@ if ($cfg['UploadDir'] != '' && !isset($is_inside_querywindow) || while ($file = @readdir($handle)) { if (is_file($cfg['UploadDir'] . $file) && substr($file, -4) == '.sql') { if ($is_first == 0) { + $is_upload_dir = true; echo "\n"; echo ' ' . ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && $querydisplay_tab == 'full') || !isset($is_inside_querywindow) ? '' . $strOr . '' : '') . ' ' . $strWebServerUploadDirectory . ' :
' . "\n"; echo '
' . "\n"; @@ -225,6 +208,30 @@ if (function_exists('PMA_set_enc_form')) { echo PMA_set_enc_form(' '); } +// Charset conversion options +if ($is_upload || $is_upload_dir) { + if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) { + echo '
' . "\n"; + $temp_charset = reset($cfg['AvailableCharsets']); + echo $strCharsetOfFile . "\n" + . '
' . "\n" . ' '; + echo '
' . "\n"; + } // end if (recoding) +} + // Bookmark Support $bookmark_go = FALSE; if (!isset($is_inside_querywindow) ||