diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index dcb98aa8..d5a9b763 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -769,7 +769,7 @@ username.form['auth[driver]'].onchange(); } else { $this->databasesPrint($missing); if (DB == "" || !$missing) { - echo "
-

focus(document.getElementsByTagName('textarea')[0]);\n"); -?> -

- "; +if (!isset($_GET["import"])) { + $q = $_GET["sql"]; // overwrite $q from if ($_POST) to save memory + if ($_POST) { + $q = $_POST["query"]; + } elseif ($_GET["history"] == "all") { + $q = $history; + } elseif ($_GET["history"] != "") { + $q = $history[$_GET["history"]][0]; + } + echo "

"; + textarea("query", $q, 20); + echo ($_POST ? "" : "\n"); + echo "

$execute\n"; + +} else { + echo "

" . lang('File upload') . "
"; + echo (ini_bool("file_uploads") + ? ' (< ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary + : lang('File uploads are disabled.') + ); + echo "\n$execute"; + echo "
\n"; + echo "
" . lang('From server') . "
"; + echo lang('Webserver file %s', "adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . ""); + echo ' '; + echo "
\n"; + echo "

"; +} + +echo checkbox("error_stops", 1, ($_POST ? $_POST["error_stops"] : isset($_GET["import"])), lang('Stop on error')) . "\n"; echo checkbox("only_errors", 1, $_POST["only_errors"], lang('Show only errors')) . "\n"; -echo "

" . (ini_bool("file_uploads") - ? lang('File upload') . ': (< ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary - : lang('File uploads are disabled.') -); - -print_fieldset("webfile", lang('From server'), $_POST["webfile"], "document.getElementById('form')['only_errors'].checked = true; "); -echo lang('Webserver file %s', "adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . ""); -echo ' '; -echo "\n"; - -if ($history) { +if (!isset($_GET["import"]) && $history) { print_fieldset("history", lang('History'), $_GET["history"] != ""); for ($val = end($history); $val; $val = prev($history)) { // not array_reverse() to save memory $key = key($history); diff --git a/changes.txt b/changes.txt index e9b030a2..94082215 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 4.0.0-dev: Driver for SimpleDB and Elasticsearch Save and continue edit by AJAX +Split SQL command and import Add a new column in alter table on key press Mark length as required for strings Add label to database selection