diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 93195b99..9e0ac3f5 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -68,20 +68,22 @@ class Adminer { /** Print links after select heading * @param array result of SHOW TABLE STATUS - * @param strin new item options, NULL for no new item + * @param string new item options, NULL for no new item * @return null */ function selectLinks($tableStatus, $set = "") { - $TABLE = $tableStatus["Name"]; - echo '

' . lang('Select table') . ''; - echo ' ' . lang('Table structure') . ''; + echo '

'; + $links = array("select" => lang('Select table'), "table" => lang('Table structure')); if (isset($tableStatus["Rows"])) { - echo ' ' . lang('Alter table') . ''; + $links["create"] = lang('Alter table'); } else { - echo ' ' . lang('Alter view') . ''; + $links["view"] = lang('Alter view'); } if (isset($set)) { - echo ' ' . lang('New item') . ''; + $links["edit"] = lang('New item'); + } + foreach ($links as $key => $val) { + echo " " . (isset($_GET[$key]) ? "$val" : $val) . ""; } echo "\n"; } diff --git a/adminer/table.inc.php b/adminer/table.inc.php index 742723ed..94563932 100644 --- a/adminer/table.inc.php +++ b/adminer/table.inc.php @@ -5,10 +5,9 @@ if (!$fields) { $error = h($connection->error); } $table_status = ($fields ? table_status($TABLE) : array()); -$is_view = !isset($table_status["Rows"]); -page_header(($fields && $is_view ? lang('View') : lang('Table')) . ": " . h($TABLE), $error); -$adminer->selectLinks($table_status, $is_view ? null : ""); +page_header(($fields && !isset($table_status["Rows"]) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error); +$adminer->selectLinks($table_status); if ($fields) { echo "\n";