Display choice for charset also when only UploadDir available.

This commit is contained in:
Michal Čihař
2003-04-14 13:17:18 +00:00
parent 870b321052
commit 54ebc1cf4f
3 changed files with 54 additions and 38 deletions

View File

@@ -137,24 +137,6 @@ if ($is_upload && (!isset($is_inside_querywindow) ||
<div style="margin-bottom: 5px">
<input type="file" name="sql_file" class="textfield" /><br />
<?php
if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
$temp_charset = reset($cfg['AvailableCharsets']);
echo $strCharsetOfFile . "\n"
. ' <select name="charset_of_file" size="1">' . "\n"
. ' <option value="' . $temp_charset . '"';
if ($temp_charset == $charset) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>' . "\n";
while ($temp_charset = next($cfg['AvailableCharsets'])) {
echo ' <option value="' . $temp_charset . '"';
if ($temp_charset == $charset) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>' . "\n";
} // end while
echo ' </select><br />' . "\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) ? '<i>' . $strOr . '</i>' : '') . ' ' . $strWebServerUploadDirectory . '&nbsp;:<br />' . "\n";
echo ' <div style="margin-bottom: 5px">' . "\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 ' <div style="margin-bottom: 5px">' . "\n";
$temp_charset = reset($cfg['AvailableCharsets']);
echo $strCharsetOfFile . "\n"
. ' <select name="charset_of_file" size="1">' . "\n"
. ' <option value="' . $temp_charset . '"';
if ($temp_charset == $charset) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>' . "\n";
while ($temp_charset = next($cfg['AvailableCharsets'])) {
echo ' <option value="' . $temp_charset . '"';
if ($temp_charset == $charset) {
echo ' selected="selected"';
}
echo '>' . $temp_charset . '</option>' . "\n";
}
echo ' </select><br />' . "\n" . ' ';
echo ' </div>' . "\n";
} // end if (recoding)
}
// Bookmark Support
$bookmark_go = FALSE;
if (!isset($is_inside_querywindow) ||