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; + ?> +
\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 "
\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; ?> +\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 "
\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";
}
}
}