From e5a7f75807ef2dc7e820118ed66e388355226bb1 Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Sun, 6 Oct 2024 00:43:49 +0200 Subject: [PATCH] Full width design for database select box --- adminer/include/adminer.inc.php | 48 +++++++++++++++++++-------------- adminer/static/default.css | 4 +-- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 4f864177..993e16c8 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -1069,42 +1069,50 @@ bodyLoad('databases(); if (DB && $databases && !in_array(DB, $databases)) { array_unshift($databases, DB); } - ?> -
-

-

"; hidden_fields_get(); - $db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});"); - echo "" . lang('DB') . ": " . ($databases - ? "$db_events" - : "\n" - ); + + if ($databases) { + echo "" + . script("mixin(qs('#database-select'), {onmousedown: dbMouseDown, onchange: dbChange});"); + } else { + echo "\n"; + } echo "\n"; - if (support("scheme")) { - if ($missing != "db" && DB != "" && $connection->select_db(DB)) { - echo "
" . lang('Schema') . ": $db_events"; - if ($_GET["ns"] != "") { - set_schema($_GET["ns"]); - } + + if (support("scheme") && $missing != "db" && DB != "" && $connection->select_db(DB)) { + echo "
" + . script("mixin(qs('#scheme-select'), {onmousedown: dbMouseDown, onchange: dbChange});"); + + if ($_GET["ns"] != "") { + set_schema($_GET["ns"]); } } - foreach (array("import", "sql", "schema", "dump", "privileges") as $val) { + + foreach (["import", "sql", "schema", "dump", "privileges"] as $val) { if (isset($_GET[$val])) { echo ""; break; } } + echo "

\n"; + + return null; } function printTablesFilter() diff --git a/adminer/static/default.css b/adminer/static/default.css index fc77e680..beeba98d 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -25,7 +25,7 @@ pre { margin: 1em 0 0; } pre code { display: block; font-size: 100%; } pre, textarea { font: 110%/1.25 monospace; } pre.jush { background: #fff; } -input, textarea { box-sizing: border-box; } +input, textarea, select { box-sizing: border-box; } input, select { vertical-align: middle; } input.default { box-shadow: 1px 1px 1px #777; } input.required { box-shadow: 1px 1px 1px red; } @@ -85,7 +85,7 @@ input::placeholder { color: #000; opacity: 0.4; } #schema { margin-left: 60px; position: relative; -moz-user-select: none; -webkit-user-select: none; } #schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; } #schema .references { position: absolute; } -#tables-filter { width: 100%; } +#tables-filter, #database-select, #scheme-select { width: 100%; } #help { position: absolute; border: 1px solid #999; background: #eee; padding: 5px; font-family: monospace; z-index: 1; } .rtl h2 { margin: 0 -18px 20px 0; }