From a9b2ac915dfeb9c4a70b72dfdda1be37dcecca2e Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 1 Jul 2011 17:15:45 +0200 Subject: [PATCH] Display searched columns --- changes.txt | 1 + editor/example.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changes.txt b/changes.txt index c7491ca8..3b79d7bb 100644 --- a/changes.txt +++ b/changes.txt @@ -14,6 +14,7 @@ Pagination support (Oracle) Autocomplete for big foreign keys (Editor) Display name of the referenced record in PostgreSQL (Editor) Prefer NULL to empty string (Editor, bug #3323800) +Display searched columns (Editor) Customizable favicon (customization) Method name can return a link (customization) Easier sending of default headers (customization) diff --git a/editor/example.php b/editor/example.php index f0c3b9e4..dc7cb765 100644 --- a/editor/example.php +++ b/editor/example.php @@ -32,8 +32,16 @@ function adminer_object() { if ($order && ereg('_(md5|sha1)$', $field["field"])) { return ""; // hide hashes in select } - // only columns with comments will be displayed and only the first five in select - return ($order <= 5 ? h($field["comment"]) : ""); + // display only column with comments, first five of them plus searched columns + 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 ""; } }