diff --git a/ChangeLog b/ChangeLog index 9d721d3a1e..ef70d93d76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ phpMyAdmin - ChangeLog - issue #17143 Use composer/ca-bundle to manage the CA cert file - issue #17143 Require the openssl PHP extension - issue #17171 Remove the printview.css file from themes +- issue #17203 Redesign the export and the import pages 5.1.2 (not yet released) - issue Replaced MySQL documentation redirected links diff --git a/js/src/export.js b/js/src/export.js index f91bd057c6..983c66d25a 100644 --- a/js/src/export.js +++ b/js/src/export.js @@ -282,9 +282,9 @@ AJAX.registerOnload('export.js', function () { * according to the currently selected plugin from the dropdown list */ $('#plugins').on('change', function () { - $('#format_specific_opts').find('div.format_specific_options').hide(); + $('#format_specific_opts').find('div.format_specific_options').addClass('d-none'); var selectedPluginName = $('#plugins').find('option:selected').val(); - $('#' + selectedPluginName + '_options').show(); + $('#' + selectedPluginName + '_options').removeClass('d-none'); }); /** @@ -704,15 +704,15 @@ Export.toggleQuickOrCustom = function () { $('#rows').show(); $('#output').show(); $('#format_specific_opts').show(); - $('#output_quick_export').hide(); + $('#output_quick_export').addClass('d-none'); var selectedPluginName = $('#plugins').find('option:selected').val(); - $('#' + selectedPluginName + '_options').show(); + $('#' + selectedPluginName + '_options').removeClass('d-none'); } else { // quick $('#databases_and_tables').hide(); $('#rows').hide(); $('#output').hide(); $('#format_specific_opts').hide(); - $('#output_quick_export').show(); + $('#output_quick_export').removeClass('d-none'); } }; @@ -835,14 +835,8 @@ Export.addAlias = function (type, name, field, value) { AJAX.registerOnload('export.js', function () { $('input[type=\'radio\'][name=\'quick_or_custom\']').on('change', Export.toggleQuickOrCustom); - $('#scroll_to_options_msg').hide(); $('#format_specific_opts').find('div.format_specific_options') - .hide() - .css({ - 'border': 0, - 'margin': 0, - 'padding': 0 - }) + .addClass('d-none') .find('h3') .remove(); Export.toggleQuickOrCustom(); @@ -860,7 +854,7 @@ AJAX.registerOnload('export.js', function () { * Disables the "Dump some row(s)" sub-options when it is not selected */ $('input[type=\'radio\'][name=\'allrows\']').on('change', function () { - if ($('input[type=\'radio\'][name=\'allrows\']').prop('checked')) { + if ($('#radio_allrows_0').prop('checked')) { Export.enableDumpSomeRowsSubOptions(); } else { Export.disableDumpSomeRowsSubOptions(); diff --git a/js/src/import.js b/js/src/import.js index 94fe01954a..989b35b51f 100644 --- a/js/src/import.js +++ b/js/src/import.js @@ -14,10 +14,11 @@ function changePluginOpts () { }); var selectedPluginName = $('#plugins').find('option:selected').val(); $('#' + selectedPluginName + '_options').fadeIn('slow'); + + const importNotification = document.getElementById('import_notification'); + importNotification.innerText = ''; if (selectedPluginName === 'csv') { - $('#import_notification').text(Messages.strImportCSV); - } else { - $('#import_notification').text(''); + importNotification.innerHTML = '
' + Messages.strImportDialogMessage + '
' + Messages.strTableNameDialogMessage + '
' + Messages.strDBNameDialogMessage + '
' + Messages.strNoImportFile + ' ' + Functions.escapeHtml(dependson) + ' -> ' + Functions.escapeHtml(pd[dependson].toString()) + '
'; + extra += '' + Functions.escapeHtml(dependson) + ' -> ' + Functions.escapeHtml(pd[dependson].toString()) + '
'; } } if (!pdFound) { - extra += '' + Messages.strNoPdSelected + '
'; + extra += '' + Messages.strNoPdSelected + '
'; extra += ''; } else { extra += ''; @@ -357,12 +357,12 @@ function goTo3NFStep2 (pd, tablesTds) { var dependson = tablesTds[table][i]; if (dependson !== '' && dependson !== table) { pdFound = true; - extra += '' + Functions.escapeHtml(dependson) + ' -> ' + Functions.escapeHtml(pd[dependson].toString()) + '
'; + extra += '' + Functions.escapeHtml(dependson) + ' -> ' + Functions.escapeHtml(pd[dependson].toString()) + '
'; } } } if (!pdFound) { - extra += '' + Messages.strNoTdSelected + '
'; + extra += '' + Messages.strNoTdSelected + '
'; extra += ''; } else { extra += ''; diff --git a/libraries/classes/Controllers/Database/ImportController.php b/libraries/classes/Controllers/Database/ImportController.php index 803400fb15..42363d4a48 100644 --- a/libraries/classes/Controllers/Database/ImportController.php +++ b/libraries/classes/Controllers/Database/ImportController.php @@ -107,6 +107,7 @@ final class ImportController extends AbstractController $options = Plugins::getOptions('Import', $importList); $skipQueriesDefault = Plugins::getDefault('Import', 'skip_queries'); $isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt'); + $maxUploadSize = (int) $GLOBALS['config']->get('max_upload_size'); $this->render('database/import/index', [ 'page_settings_error_html' => $pageSettingsErrorHtml, @@ -116,7 +117,8 @@ final class ImportController extends AbstractController 'hidden_inputs' => $hiddenInputs, 'db' => $db, 'table' => $table, - 'max_upload_size' => $GLOBALS['config']->get('max_upload_size'), + 'max_upload_size' => $maxUploadSize, + 'formatted_maximum_upload_size' => Util::getFormattedMaximumUploadSize($maxUploadSize), 'plugins_choice' => $choice, 'options' => $options, 'skip_queries_default' => $skipQueriesDefault, diff --git a/libraries/classes/Controllers/Server/ImportController.php b/libraries/classes/Controllers/Server/ImportController.php index 8d3cb0e88e..897e689a84 100644 --- a/libraries/classes/Controllers/Server/ImportController.php +++ b/libraries/classes/Controllers/Server/ImportController.php @@ -92,6 +92,7 @@ final class ImportController extends AbstractController $options = Plugins::getOptions('Import', $importList); $skipQueriesDefault = Plugins::getDefault('Import', 'skip_queries'); $isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt'); + $maxUploadSize = (int) $GLOBALS['config']->get('max_upload_size'); $this->render('server/import/index', [ 'page_settings_error_html' => $pageSettingsErrorHtml, @@ -101,7 +102,8 @@ final class ImportController extends AbstractController 'hidden_inputs' => $hiddenInputs, 'db' => $db, 'table' => $table, - 'max_upload_size' => $GLOBALS['config']->get('max_upload_size'), + 'max_upload_size' => $maxUploadSize, + 'formatted_maximum_upload_size' => Util::getFormattedMaximumUploadSize($maxUploadSize), 'plugins_choice' => $choice, 'options' => $options, 'skip_queries_default' => $skipQueriesDefault, diff --git a/libraries/classes/Controllers/Table/ImportController.php b/libraries/classes/Controllers/Table/ImportController.php index 86b3217d03..09ff7b3080 100644 --- a/libraries/classes/Controllers/Table/ImportController.php +++ b/libraries/classes/Controllers/Table/ImportController.php @@ -105,6 +105,7 @@ final class ImportController extends AbstractController $options = Plugins::getOptions('Import', $importList); $skipQueriesDefault = Plugins::getDefault('Import', 'skip_queries'); $isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt'); + $maxUploadSize = (int) $GLOBALS['config']->get('max_upload_size'); $this->render('table/import/index', [ 'page_settings_error_html' => $pageSettingsErrorHtml, @@ -114,7 +115,8 @@ final class ImportController extends AbstractController 'hidden_inputs' => $hiddenInputs, 'db' => $db, 'table' => $table, - 'max_upload_size' => $GLOBALS['config']->get('max_upload_size'), + 'max_upload_size' => $maxUploadSize, + 'formatted_maximum_upload_size' => Util::getFormattedMaximumUploadSize($maxUploadSize), 'plugins_choice' => $choice, 'options' => $options, 'skip_queries_default' => $skipQueriesDefault, diff --git a/libraries/classes/Export.php b/libraries/classes/Export.php index 83f62debd5..b148b23e5f 100644 --- a/libraries/classes/Export.php +++ b/libraries/classes/Export.php @@ -549,7 +549,7 @@ class Export * Displays a back button with all the $_POST data in the URL * (store in a variable to also display after the textarea) */ - $backButton = '