From 294b10b40caad776d72c2ac0276e3170cc9315b9 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 24 Nov 2009 09:44:28 +0000 Subject: [PATCH] Highlight current link git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1251 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/adminer.inc.php | 16 +++++++++------- adminer/table.inc.php | 5 ++--- 2 files changed, 11 insertions(+), 10 deletions(-) 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";