From 6a486181dd09327980d1eb29070bc9c95ab926f1 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 29 Jul 2012 16:05:37 -0700 Subject: [PATCH] Autodisplay long table names in tables list --- adminer/include/adminer.inc.php | 42 ++++++++++++++++----------------- adminer/static/default.css | 4 +++- changes.txt | 1 + editor/include/adminer.inc.php | 2 +- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index faf80c65..eedee5cf 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -803,7 +803,7 @@ DROP PROCEDURE adminer_alter;

-

+

"(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : ''); ?> > @@ -815,31 +815,31 @@ DROP PROCEDURE adminer_alter; set_schema($_GET["ns"]); } } - if ($_GET["ns"] !== "" && !$missing) { - echo '

" . lang('Create new table') . "\n"; - $tables = tables_list(); - if (!$tables) { - echo "

" . lang('No tables.') . "\n"; - } else { - $this->tablesPrint($tables); - $links = array(); - foreach ($tables as $table => $type) { - $links[] = preg_quote($table, '/'); - } - echo "\n"; - } - } } echo (isset($_GET["sql"]) ? '' : (isset($_GET["schema"]) ? '' : (isset($_GET["dump"]) ? '' : ""))); echo "

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

" . lang('Create new table') . "\n"; + $tables = tables_list(); + if (!$tables) { + echo "

" . lang('No tables.') . "\n"; + } else { + $this->tablesPrint($tables); + $links = array(); + foreach ($tables as $table => $type) { + $links[] = preg_quote($table, '/'); + } + echo "\n"; + } + } } } @@ -848,7 +848,7 @@ DROP PROCEDURE adminer_alter; * @return null */ function tablesPrint($tables) { - echo "

\n"; + echo '

' . "\n"; foreach ($tables as $table => $type) { echo '" . lang('select') . " "; echo '" . $this->tableName(array("Name" => $table)) . "
\n"; //! Adminer::tableName may work with full table status diff --git a/adminer/static/default.css b/adminer/static/default.css index 0351ee0c..12837e55 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -45,8 +45,10 @@ input[type=image] { vertical-align: middle; } .active { font-weight: bold; } .sqlarea { width: 98%; } .icon { width: 18px; height: 18px; } -#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; } +#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; white-space: nowrap; } #menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; } +#tables { overflow: auto; } +#tables a { background: #fff; } #content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; } #lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; } #breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; } diff --git a/changes.txt b/changes.txt index 820bb863..8a5fc6b2 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 3.4.1-dev: Links for column search in select Autohide column context menu in select +Autodisplay long table names in tables list Display assigned auto_increment after clone SQLite: Full alter table SQLite: Better editing in tables without primary key diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index d5210331..0d171ab1 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -559,7 +559,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 } function tablesPrint($tables) { - echo "

\n"; + echo '

' . "\n"; foreach ($tables as $row) { $name = $this->tableName($row); if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name