Checkbox for bool in psql
This commit is contained in:
parent
6c84764334
commit
a062e9cc58
|
@ -890,6 +890,9 @@ function input($field, $value, $function) {
|
||||||
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
|
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
|
||||||
if ($input != "") {
|
if ($input != "") {
|
||||||
echo $input;
|
echo $input;
|
||||||
|
} elseif (preg_match('~bool~', $field["type"])) {
|
||||||
|
echo "<input type='hidden'$attrs value='0'>" .
|
||||||
|
"<input type='checkbox'" . (in_array(strtolower($value), array('1', 't', 'true', 'y', 'yes', 'on')) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||||
} elseif ($field["type"] == "set") { //! 64 bits
|
} elseif ($field["type"] == "set") { //! 64 bits
|
||||||
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
||||||
foreach ($matches[1] as $i => $val) {
|
foreach ($matches[1] as $i => $val) {
|
||||||
|
|
Loading…
Reference in a new issue