Display searched columns

This commit is contained in:
Jakub Vrana 2011-07-01 17:15:45 +02:00
parent d26fb6276e
commit a9b2ac915d
2 changed files with 11 additions and 2 deletions

View file

@ -14,6 +14,7 @@ Pagination support (Oracle)
Autocomplete for big foreign keys (Editor) Autocomplete for big foreign keys (Editor)
Display name of the referenced record in PostgreSQL (Editor) Display name of the referenced record in PostgreSQL (Editor)
Prefer NULL to empty string (Editor, bug #3323800) Prefer NULL to empty string (Editor, bug #3323800)
Display searched columns (Editor)
Customizable favicon (customization) Customizable favicon (customization)
Method name can return a link (customization) Method name can return a link (customization)
Easier sending of default headers (customization) Easier sending of default headers (customization)

View file

@ -32,8 +32,16 @@ function adminer_object() {
if ($order && ereg('_(md5|sha1)$', $field["field"])) { if ($order && ereg('_(md5|sha1)$', $field["field"])) {
return ""; // hide hashes in select return ""; // hide hashes in select
} }
// only columns with comments will be displayed and only the first five in select // display only column with comments, first five of them plus searched columns
return ($order <= 5 ? h($field["comment"]) : ""); if ($order < 5) {
return h($field["comment"]);
}
foreach ((array) $_GET["where"] as $key => $where) {
if ($where["col"] == $field["field"] && ($key >= 0 || $where["val"] != "")) {
return h($field["comment"]);
}
}
return "";
} }
} }