1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 15:16:44 +02:00

Updated Technical Wiki (markdown)

apmuthu
2014-11-27 07:53:05 -08:00
parent 4da55847dc
commit f4f94203f8

@@ -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 "";
}
````