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

New plugin: Configure options by end-users and store them to a cookie

This commit is contained in:
Jakub Vrana
2025-04-06 06:24:55 +02:00
parent 48f82b3454
commit cca943015f
6 changed files with 81 additions and 2 deletions

View File

@@ -300,6 +300,13 @@ class Adminer {
return $val;
}
/** Get configuration options for AdminerConfig
* @return string[] key is config description, value is HTML
*/
function config(): array {
return array();
}
/** Print table structure in tabular format
* @param Field[] $fields
* @param TableStatus $tableStatus

View File

@@ -100,7 +100,7 @@ function html_select(string $name, array $options, ?string $value = "", string $
/** Generate HTML radio list
* @param string[] $options
*/
function html_radios(string $name, array $options, string $value = ""): string {
function html_radios(string $name, array $options, ?string $value = ""): string {
$return = "";
foreach ($options as $key => $val) {
$return .= "<label><input type='radio' name='" . h($name) . "' value='" . h($key) . "'" . ($key == $value ? " checked" : "") . ">" . h($val) . "</label>";

View File

@@ -2,7 +2,7 @@
namespace Adminer;
class Plugins {
/** @var true[] */ private static array $append = array('dumpFormat' => true, 'dumpOutput' => true, 'editRowPrint' => true, 'editFunctions' => true); // these hooks expect the value to be appended to the result
/** @var true[] */ private static array $append = array('dumpFormat' => true, 'dumpOutput' => true, 'editRowPrint' => true, 'editFunctions' => true, 'config' => true); // these hooks expect the value to be appended to the result
/** @var list<object> @visibility protected(set) */ public array $plugins;
/** @visibility protected(set) */ public string $error = ''; // HTML