]> git.joonet.de Git - adminer.git/commitdiff
Highlight current link
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 24 Nov 2009 09:44:28 +0000 (09:44 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 24 Nov 2009 09:44:28 +0000 (09:44 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1251 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/adminer.inc.php
adminer/table.inc.php

index 93195b995ba60d3248810357d16c8cdfeaf5b8c4..9e0ac3f581e3179651e79be53c6cf67b89ec4276 100644 (file)
@@ -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 '<p class="tabs"><a href="' . h(ME) . 'select=' . urlencode($TABLE) . '">' . lang('Select table') . '</a>';
-               echo ' <a href="' . h(ME) . 'table=' . urlencode($TABLE) . '">' . lang('Table structure') . '</a>';
+               echo '<p class="tabs">';
+               $links = array("select" => lang('Select table'), "table" => lang('Table structure'));
                if (isset($tableStatus["Rows"])) {
-                       echo ' <a href="' . h(ME) . 'create=' . urlencode($TABLE) . '">' . lang('Alter table') . '</a>';
+                       $links["create"] = lang('Alter table');
                } else {
-                       echo ' <a href="' . h(ME) . 'view=' . urlencode($TABLE) . '">' . lang('Alter view') . '</a>';
+                       $links["view"] = lang('Alter view');
                }
                if (isset($set)) {
-                       echo ' <a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . '</a>';
+                       $links["edit"] = lang('New item');
+               }
+               foreach ($links as $key => $val) {
+                       echo " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'>" . (isset($_GET[$key]) ? "<b>$val</b>" : $val) . "</a>";
                }
                echo "\n";
        }
index 742723ed5175cd97b4b73f8e60c3863217ae100e..94563932a883e7277d9bbba115b5375c53c5b2c9 100644 (file)
@@ -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 "<table cellspacing='0'>\n";