Checkbox for bool in psql

This commit is contained in:
Adam Kuśmierz 2016-06-29 18:27:34 +02:00 committed by Jakub Vrana
parent 6c84764334
commit a062e9cc58

View file

@ -890,6 +890,9 @@ function input($field, $value, $function) {
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($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
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {