1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 14:46:36 +02:00

Highlight syntax

Jakub Vrána
2021-08-30 10:12:11 +02:00
parent d3d041a2e5
commit 34ea0773be

@@ -17,7 +17,7 @@ Best project EVER.
* Method ````permanentLogin()```` is used for [permanent storing passwords in cookies](https://sourceforge.net/p/adminer/discussion/960418/thread/a878c666/#99f1). Returned string is a key so you should change it to anything else (preferably random). You can also take it out but then permanent login would be disabled.
The example.php can be used to limit the tables displayed to a specific list with:
````
```php
function tableName($tableStatus) {
// tables without comments would return empty string and will be ignored by Adminer
$allowed_tables = Array('mytable1', 'mytable2');
@@ -26,9 +26,9 @@ The example.php can be used to limit the tables displayed to a specific list wit
else
return '';
}
````
```
Different possibilities with columns to be displayed in the table initial listing:
````
```php
function fieldName($field, $order = 0) {
/*
$field = Array
@@ -79,10 +79,10 @@ $field = Array
}
return "";
}
````
```
* Different number of records in listing and select choices:
````
```php
function selectLimitProcess() {
return (isset($_GET["limit"]) ? $_GET["limit"] : "20");
}
@@ -92,10 +92,10 @@ $field = Array
echo html_select("limit", array("", "20", "50", "100"), $limit);
echo "</div></fieldset>\n";
}
````
```
* Enable Record View beside Edit link:
````
```diff
--- adminer/include/functions.inc.php Mon Jan 25 04:02:41 2016
+++ adminer/include/functions.inc.php Tue Feb 02 12:34:43 2016
@@ -864,6 +864,7 @@
@@ -156,9 +156,9 @@ $field = Array
foreach ($row as $key => $val) {
if (isset($names[$key])) {
````
```
* 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.
````
```php
function fieldName($field, $order = 0) {
if ($order && preg_match('~_(md5|sha1)$~', $field["field"])) {
return ""; // hide hashes in select
@@ -188,11 +188,11 @@ $field = Array
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````):
````
```php
function selectLink($val, $field) {
if ($field['field'] == 'ORID' && $_GET['select'] == 'chq_batches' && $val !== NULL)
return 'orslip.php?select=chq_batches&orid='.$val;
}
````
```