From beafccb8c3913702640ddc6e7b269db025923238 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 20 Aug 2012 22:03:39 -0700 Subject: [PATCH] Separate printing databases in customization --- adminer/include/adminer.inc.php | 51 ++++++++++++++++++++------------- editor/include/adminer.inc.php | 4 +++ 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 6bebe422..65bc2dbb 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -771,7 +771,7 @@ DROP PROCEDURE adminer_alter; * @return null */ function navigation($missing) { - global $VERSION, $connection, $token, $jush, $drivers; + global $VERSION, $token, $jush, $drivers; ?>

name(); ?> @@ -809,26 +809,8 @@ DROP PROCEDURE adminer_alter;

-databases(); ?> -
-

- - "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : ''); ?> -> select_db(DB)) { - if (support("scheme")) { - echo "
" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();"); - if ($_GET["ns"] != "") { - set_schema($_GET["ns"]); - } - } - } - echo (isset($_GET["sql"]) ? '' - : (isset($_GET["schema"]) ? '' - : (isset($_GET["dump"]) ? '' - : ""))); - echo "

\n"; + $this->databasesPrint($missing); if ($_GET["ns"] !== "" && !$missing && DB != "") { echo '

" . lang('Create new table') . "\n"; $tables = tables_list(); @@ -851,6 +833,35 @@ DROP PROCEDURE adminer_alter; } } + /** Prints databases list in menu + * @param string + * @return null + */ + function databasesPrint($missing) { + global $connection; + $databases = $this->databases(); + ?> +

+

+ + "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : ''); ?> +> +select_db(DB)) { + if (support("scheme")) { + echo "
" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();"); + if ($_GET["ns"] != "") { + set_schema($_GET["ns"]); + } + } + } + echo (isset($_GET["sql"]) ? '' + : (isset($_GET["schema"]) ? '' + : (isset($_GET["dump"]) ? '' + : ""))); + echo "

\n"; + } + /** Prints table list in menu * @param array * @return null diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 54a0796a..019833b6 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -553,6 +553,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5

databasesPrint($missing); if ($missing != "db" && $missing != "ns") { $table_status = table_status(); if (!$table_status) { @@ -564,6 +565,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 } } + function databasesPrint($missing) { + } + function tablesPrint($tables) { echo "

\n"; foreach ($tables as $row) {