mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +02:00
Updated Technical Wiki (markdown)
@@ -156,27 +156,35 @@ $field = Array
|
||||
````
|
||||
* Hide Auto-increment Primary Key in New Record Form (populate ````$hidePKfields```` as needed). Alternatively, just the table names would suffice where the primary key can be ascertained from the ````$field['primary'] == 1```` taking the field name from ````$field['field']```` element.
|
||||
````
|
||||
function fieldName($field, $order = 0) {
|
||||
..
|
||||
..
|
||||
..
|
||||
// Hide AutoInc Primary keys during Insert
|
||||
if (isset($_GET['edit'])) {
|
||||
$hidePKfields = Array(
|
||||
Array('htable' => 'cheques', 'hfield' => 'ChqID')
|
||||
, Array('htable' => 'chq_batches', 'hfield' => 'ORID')
|
||||
);
|
||||
foreach ($hidePKfields as $val) {
|
||||
if ($_GET['edit'] == $val['htable'] && $field['field'] == $val['hfield'] && !isset($_GET['where'][$val['hfield']]))
|
||||
return "";
|
||||
}
|
||||
}
|
||||
..
|
||||
..
|
||||
..
|
||||
return "";
|
||||
function fieldName($field, $order = 0) {
|
||||
if ($order && preg_match('~_(md5|sha1)$~', $field["field"])) {
|
||||
return ""; // hide hashes in select
|
||||
}
|
||||
|
||||
// Hide AutoInc Primary keys during Insert
|
||||
if (isset($_GET['edit'])) {
|
||||
$hidePKfields = Array(
|
||||
Array('htable' => 'employees', 'hfield' => 'EmployeeID')
|
||||
, Array('htable' => 'leaves', 'hfield' => 'LeaveID')
|
||||
);
|
||||
foreach ($hidePKfields as $val) {
|
||||
if ($_GET['edit'] == $val['htable'] && $field['field'] == $val['hfield'] && !isset($_GET['where'][$val['hfield']]))
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// display only column with comments, first 60 of them plus searched columns
|
||||
if ($order < 60) {
|
||||
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 "";
|
||||
}
|
||||
|
||||
````
|
||||
* To link a table's (````chq_batches````) displayed field (````ORID````) value to an external file as a link with it's value in the url using a $_GET variable (````orid````):
|
||||
````
|
||||
|
Reference in New Issue
Block a user