Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Display searched columns

  • Loading branch information...
commit a9b2ac915dfeb9c4a70b72dfdda1be37dcecca2e 1 parent d26fb62
Jakub Vrána authored July 01, 2011
1  changes.txt
@@ -14,6 +14,7 @@ Pagination support (Oracle)
14 14
 Autocomplete for big foreign keys (Editor)
15 15
 Display name of the referenced record in PostgreSQL (Editor)
16 16
 Prefer NULL to empty string (Editor, bug #3323800)
  17
+Display searched columns (Editor)
17 18
 Customizable favicon (customization)
18 19
 Method name can return a link (customization)
19 20
 Easier sending of default headers (customization)
12  editor/example.php
@@ -32,8 +32,16 @@ function fieldName($field, $order = 0) {
32 32
 			if ($order && ereg('_(md5|sha1)$', $field["field"])) {
33 33
 				return ""; // hide hashes in select
34 34
 			}
35  
-			// only columns with comments will be displayed and only the first five in select
36  
-			return ($order <= 5 ? h($field["comment"]) : "");
  35
+			// display only column with comments, first five of them plus searched columns
  36
+			if ($order < 5) {
  37
+				return h($field["comment"]);
  38
+			}
  39
+			foreach ((array) $_GET["where"] as $key => $where) {
  40
+				if ($where["col"] == $field["field"] && ($key >= 0 || $where["val"] != "")) {
  41
+					return h($field["comment"]);
  42
+				}
  43
+			}
  44
+			return "";
37 45
 		}
38 46
 		
39 47
 	}

0 notes on commit a9b2ac9

Please sign in to comment.
Something went wrong with that request. Please try again.