From d3227c963f83a3cf9ee9b4343a10afa6edcb0ac7 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sat, 19 Sep 2009 20:16:15 +0000 Subject: [PATCH] Move

to $adminer->navigation git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1118 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/adminer.inc.php | 44 ++++++++++++++++++++++++--------- adminer/include/design.inc.php | 9 ++----- editor/editing.js | 2 -- editor/include/adminer.inc.php | 35 +++++++++++++++++--------- 4 files changed, 58 insertions(+), 32 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 4cb09aca..793fc770 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -414,7 +414,18 @@ class Adminer { * @return null */ function navigation($missing) { - global $dbh; + global $VERSION; + ?> +

+name(); ?> + + +

+ + @@ -442,19 +453,28 @@ class Adminer {

select_db(DB)) { - $result = $dbh->query("SHOW TABLES"); - if (!$result->num_rows) { - echo "

" . lang('No tables.') . "\n"; - } else { - echo "

\n"; - while ($row = $result->fetch_row()) { - echo '' . lang('select') . ' '; - echo '' . $this->tableName(array("Name" => $row[0])) . "
\n"; //! Adminer::tableName may work with full table status - } + $this->printTables($missing); + } + } + + /** Prints table list in menu + * @param string can be "db" if there is no database selected + * @return null + */ + function printTables($missing) { + global $dbh; + if ($missing != "db" && strlen(DB) && $dbh->select_db(DB)) { + $result = $dbh->query("SHOW TABLES"); + if (!$result->num_rows) { + echo "

" . lang('No tables.') . "\n"; + } else { + echo "

\n"; + while ($row = $result->fetch_row()) { + echo '' . lang('select') . ' '; + echo '' . $this->tableName(array("Name" => $row[0])) . "
\n"; //! Adminer::tableName may work with full table status } - echo '

' . lang('Create new table') . "\n"; } + echo '

' . lang('Create new table') . "\n"; } } diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index e02b5852..43661de4 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -15,7 +15,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { -"> + @@ -56,17 +56,12 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { } function page_footer($missing = false) { - global $VERSION, $adminer; + global $adminer; ?>

+

+name(); ?> + + +

+verify_version();\n"); if ($missing != "auth") { ?>
@@ -357,17 +366,21 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5

" . lang('No tables.') . "\n"; - } else { - echo "

\n"; - foreach ($table_status as $row) { - $name = $this->tableName($row); - if (isset($row["Engine"]) && strlen($name)) { // ignore views and tables without name - echo "$name
\n"; - } + $this->printTables($missing); + } + } + + function printTables($missing) { + if ($missing != "db") { + $table_status = table_status(); + if (!$table_status) { + echo "

" . lang('No tables.') . "\n"; + } else { + echo "

\n"; + foreach ($table_status as $row) { + $name = $this->tableName($row); + if (isset($row["Engine"]) && strlen($name)) { // ignore views and tables without name + echo "$name
\n"; } } }