Fix title and links on invalid table pages

This commit is contained in:
Jakub Vrana 2013-06-24 05:53:23 -07:00
parent 81e134f872
commit 2e4a7121a9
5 changed files with 14 additions and 3 deletions

View file

@ -55,7 +55,7 @@ if ($_POST && !$error && !isset($_GET["select"])) {
} }
} }
$table_name = $adminer->tableName(table_status($TABLE, true)); $table_name = $adminer->tableName(table_status1($TABLE, true));
page_header( page_header(
($update ? lang('Edit') : lang('Insert')), ($update ? lang('Edit') : lang('Insert')),
$error, $error,

View file

@ -707,6 +707,16 @@ function hidden_fields_get() {
echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">'; echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">';
} }
/** Get status of a single table and fall back to name on error
* @param string
* @param bool
* @return array
*/
function table_status1($table, $fast = false) {
$return = table_status($table, $fast);
return ($return ? $return : array("Name" => $table));
}
/** Find out foreign keys for each column /** Find out foreign keys for each column
* @param string * @param string
* @return array array($col => array()) * @return array array($col => array())

View file

@ -1,6 +1,6 @@
<?php <?php
$TABLE = $_GET["select"]; $TABLE = $_GET["select"];
$table_status = table_status($TABLE); $table_status = table_status1($TABLE);
$indexes = indexes($TABLE); $indexes = indexes($TABLE);
$fields = fields($TABLE); $fields = fields($TABLE);
$foreign_keys = column_foreign_keys($TABLE); $foreign_keys = column_foreign_keys($TABLE);

View file

@ -4,7 +4,7 @@ $fields = fields($TABLE);
if (!$fields) { if (!$fields) {
$error = error(); $error = error();
} }
$table_status = table_status($TABLE, true); $table_status = table_status1($TABLE, true);
page_header(($fields && is_view($table_status) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error); page_header(($fields && is_view($table_status) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);

View file

@ -7,6 +7,7 @@ Order table list by name
Verify UTF-8 encoding of CSV import Verify UTF-8 encoding of CSV import
Notify user about expired master password for permanent login Notify user about expired master password for permanent login
Send 404 for invalid database and schema Send 404 for invalid database and schema
Fix title and links on invalid table pages
MySQL: Speed up updating rows without numeric or UTF-8 primary key MySQL: Speed up updating rows without numeric or UTF-8 primary key
PostgreSQL: Fix detecting oid column in PDO PostgreSQL: Fix detecting oid column in PDO
PostgreSQL: Handle timestamp types (bug #3614086) PostgreSQL: Handle timestamp types (bug #3614086)