]> git.joonet.de Git - adminer.git/commitdiff
Display searched columns
authorJakub Vrana <jakub@vrana.cz>
Fri, 1 Jul 2011 15:15:45 +0000 (17:15 +0200)
committerJakub Vrana <jakub@vrana.cz>
Fri, 1 Jul 2011 15:15:45 +0000 (17:15 +0200)
changes.txt
editor/example.php

index c7491ca86381ba9e3f047edb5410c0b74aa21462..3b79d7bb60c06a7051f13b157c8c77922e20c3df 100644 (file)
@@ -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)
index f0c3b9e41145e4255bb5122d0fcd6cddca6647c7..dc7cb765da4aed87608cbbb930425ec46031b0ba 100644 (file)
@@ -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 "";
                }
                
        }