Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Highlight current link

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1251 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit 294b10b40caad776d72c2ac0276e3170cc9315b9 1 parent 3e9b1ba
jakubvrana authored
Showing with 11 additions and 10 deletions.
  1. +9 −7 adminer/include/adminer.inc.php
  2. +2 −3 adminer/table.inc.php
16 adminer/include/adminer.inc.php
View
@@ -68,20 +68,22 @@ function fieldName($field, $order = 0) {
/** 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";
}
5 adminer/table.inc.php
View
@@ -5,10 +5,9 @@
$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";
Please sign in to comment.
Something went wrong with that request. Please try again.