diff --git a/libraries/classes/Display/Import.php b/libraries/classes/Display/Import.php index 190912b2de..062eb30dbb 100644 --- a/libraries/classes/Display/Import.php +++ b/libraries/classes/Display/Import.php @@ -60,77 +60,31 @@ class Import $compressions[] = 'zip'; } - $html = ''; - $html .= ''; - $html .= '
'; - $html .= '
'; - $html .= ' ajax clock'; - - $html .= Template::get('display/import/javascript')->render([ + return Template::get('display/import/import')->render([ 'upload_id' => $upload_id, 'handler' => $_SESSION[$SESSION_KEY]["handler"], + 'id_key' => $_SESSION[$SESSION_KEY]['handler']::getIdKey(), 'pma_theme_image' => $GLOBALS['pmaThemeImage'], - ]); - - $html .= '
'; - - $html .= Template::get('display/import/hidden_inputs')->render([ 'import_type' => $import_type, 'db' => $db, 'table' => $table, - ]); - - $html .= Template::get('display/import/options')->render([ - 'import_type' => $import_type, - 'db' => $db, - 'table' => $table, - ]); - - $html .= Template::get('display/import/file_option')->render([ 'max_upload_size' => $max_upload_size, 'import_list' => $import_list, 'local_import_file' => $local_import_file, 'is_upload' => $GLOBALS['is_upload'], 'upload_dir' => isset($cfg['UploadDir']) ? $cfg['UploadDir'] : null, - 'timeout_passed' => isset($GLOBALS['timeout_passed']) ? $GLOBALS['timeout_passed'] : null, + 'timeout_passed_global' => isset($GLOBALS['timeout_passed']) ? $GLOBALS['timeout_passed'] : null, 'compressions' => $compressions, 'is_encoding_supported' => Encoding::isSupported(), 'encodings' => Encoding::listEncodings(), 'import_charset' => isset($cfg['Import']['charset']) ? $cfg['Import']['charset'] : null, 'dbi' => $GLOBALS['dbi'], 'disable_is' => $cfg['Server']['DisableIS'], - ]); - - $html .= Template::get('display/import/partial_import_option')->render([ 'timeout_passed' => isset($timeout_passed) ? $timeout_passed : null, 'offset' => $offset, - ]); - - $html .= Template::get('display/import/other_option')->render(); - - $html .= Template::get('display/import/format_option')->render([ 'import_list' => $import_list, 'can_convert_kanji' => Encoding::canConvertKanji(), ]); - - $html .= Template::get('display/import/submit_option')->render(); - - $html .= '
'; - $html .= '
'; - - return $html; } /** diff --git a/templates/display/import/file_option.twig b/templates/display/import/file_option.twig index e187d0313e..ca5d68a7b0 100644 --- a/templates/display/import/file_option.twig +++ b/templates/display/import/file_option.twig @@ -13,7 +13,7 @@
  • {{ Util_getSelectUploadFileBlock( diff --git a/templates/display/import/import.twig b/templates/display/import/import.twig new file mode 100644 index 0000000000..2c2dc13deb --- /dev/null +++ b/templates/display/import/import.twig @@ -0,0 +1,64 @@ + +
    +
    + ajax clock + + {% include 'display/import/javascript.twig' with { + 'upload_id': upload_id, + 'handler': handler, + 'pma_theme_image': pma_theme_image + } only %} + +
    + + + {% include 'display/import/hidden_inputs.twig' with { + 'import_type': import_type, + 'db': db, + 'table': table + } only %} + + {% include 'display/import/options.twig' with { + 'import_type': import_type, + 'db': db, + 'table': table + } only %} + + {% include 'display/import/file_option.twig' with { + 'max_upload_size': max_upload_size, + 'import_list': import_list, + 'local_import_file': local_import_file, + 'is_upload': is_upload, + 'upload_dir': upload_dir, + 'timeout_passed_global': timeout_passed_global, + 'compressions': compressions, + 'is_encoding_supported': is_encoding_supported, + 'encodings': encodings, + 'import_charset': import_charset, + 'dbi': dbi, + 'disable_is': disable_is + } only %} + + {% include 'display/import/partial_import_option.twig' with { + 'timeout_passed': timeout_passed, + 'offset': offset + } only %} + + {% include 'display/import/other_option.twig' only %} + + {% include 'display/import/format_option.twig' with { + 'import_list': import_list, + 'can_convert_kanji': can_convert_kanji + } only %} + + {% include 'display/import/submit_option.twig' only %} +
    +
    diff --git a/templates/display/import/javascript.twig b/templates/display/import/javascript.twig index 76474c1a6f..2e95ec1a1e 100644 --- a/templates/display/import/javascript.twig +++ b/templates/display/import/javascript.twig @@ -6,7 +6,7 @@ {# Hide form #} $("#upload_form_form").css("display", "none"); - {% if handler != 'PhpMyAdmin\Plugins\Import\Upload\UploadNoplugin' %} + {% if handler != 'PhpMyAdmin\\Plugins\\Import\\Upload\\UploadNoplugin' %} {% include 'display/import/with_plugin.twig' with { 'upload_id': upload_id, 'pma_theme_image': pma_theme_image