From f4f94203f8ab49176715bd0d190b73a3b34d757c Mon Sep 17 00:00:00 2001 From: apmuthu Date: Thu, 27 Nov 2014 07:53:05 -0800 Subject: [PATCH] Updated Technical Wiki (markdown) --- Technical-Wiki.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Technical-Wiki.md b/Technical-Wiki.md index ea6bbc8..663b118 100644 --- a/Technical-Wiki.md +++ b/Technical-Wiki.md @@ -17,3 +17,56 @@ The example.php can be used to limit the tables displayed to a specific list wit return ''; } ```` +Different possibilities with columns to be displayed in the table initial listing: +```` + function fieldName($field, $order = 0) { +/* +$field = Array +( + [field] => stock_id + [full_type] => varchar(20) + [type] => varchar + [length] => 20 + [unsigned] => + [default] => + [null] => + [auto_increment] => + [on_update] => + [collation] => utf8_general_ci + [privileges] => Array + ( + [select] => 0 + [insert] => 1 + [update] => 2 + [references] => 3 + ) + + [comment] => Part# + [primary] => 1 +) +*/ + if ($order && preg_match('~_(md5|sha1)$~', $field["field"])) { + return ""; // hide hashes in select + } + // display only column with comments, first two of them plus searched columns and specific columns + if ($order < 2) { + return h($field["comment"]); + } else if ($order) { + if (preg_match('~^(ItemDesc|category_id|UPC)$~', $field["field"])) { + return h($field["comment"]); // chosen fields ItemDesc,category_id,UPC in select + } + if (preg_match('~(Price)$~', $field["field"])) { + return h($field["comment"]); // chosen field names in select ending with Price + } + if (preg_match('~^(Product#)$~', $field["comment"])) { + return h($field["comment"]); // chosen field label Product# in select + } + } + foreach ((array) $_GET["where"] as $key => $where) { + if ($where["col"] == $field["field"] && ($key >= 0 || $where["val"] != "")) { + return h($field["comment"]); + } + } + return ""; + } +```` \ No newline at end of file