Permalink
Browse files

Highlight current links

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1253 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent ecb56e6 commit 94a2be52ba13d908f9059bef7b27f054ed82d9ea jakubvrana committed Nov 26, 2009
Showing with 17 additions and 7 deletions.
  1. +6 −6 adminer/include/adminer.inc.php
  2. +9 −0 adminer/include/functions.inc.php
  3. +1 −0 changes.txt
  4. +1 −1 editor/include/adminer.inc.php
@@ -83,7 +83,7 @@ function selectLinks($tableStatus, $set = "") {
$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 " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'>" . bold($val, isset($_GET[$key])) . "</a>";
}
echo "\n";
}
@@ -480,8 +480,8 @@ function navigation($missing) {
?>
<form action="" method="post">
<p class="logout">
-<a href="<?php echo h(ME); ?>sql="><?php echo lang('SQL command'); ?></a>
-<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo lang('Dump'); ?></a>
+<a href="<?php echo h(ME); ?>sql="><?php echo bold(lang('SQL command'), isset($_GET["sql"])); ?></a>
+<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
<input type="hidden" name="token" value="<?php echo $_SESSION["tokens"][$_GET["server"]]; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
@@ -505,7 +505,7 @@ function navigation($missing) {
} else {
$this->tablesPrint($tables);
}
- echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
+ echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
}
}
}
@@ -517,8 +517,8 @@ function navigation($missing) {
function tablesPrint($tables) {
echo "<p id='tables'>\n";
foreach ($tables as $table) {
- echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '">' . lang('select') . '</a> ';
- echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '">' . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status
+ echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '">' . bold(lang('select'), $_GET["select"] == $table) . '</a> ';
+ echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '">' . bold($this->tableName(array("Name" => $table)), $_GET["table"] == $table) . "</a><br>\n"; //! Adminer::tableName may work with full table status
}
}
@@ -526,3 +526,12 @@ function is_url($string) {
function print_fieldset($id, $legend, $visible = false) {
echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
}
+
+/** Enclose $string to <b> if $bold is true
+* @param string
+* @param bool
+* @return string
+*/
+function bold($string, $bold) {
+ return ($bold ? "<b>$string</b>" : $string);
+}
View
@@ -1,4 +1,5 @@
Adminer 2.2.1-dev:
+Highlight current links
Improve concurrency
Move number of tables to DB info (performance)
Search by foreign keys (Editor)
@@ -466,7 +466,7 @@ function tablesPrint($tables) {
foreach ($tables as $row) {
$name = $this->tableName($row);
if (isset($row["Engine"]) && strlen($name)) { // ignore views and tables without name
- echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'>$name</a><br>\n";
+ echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'>" . bold($name, $_GET["select"] == $row["Name"]) . "</a><br>\n";
}
}
}

0 comments on commit 94a2be5

Please sign in to comment.