Edit json and jsonb types in textarea
This commit is contained in:
parent
842ea0bd46
commit
4a69059e1b
|
@ -29,7 +29,7 @@ if (!$error && $_POST) {
|
||||||
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
|
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . (isset($_GET["ns"]) ? idf_escape($_GET["ns"]) . "." : "" ) . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")";
|
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
|
||||||
echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
|
echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
|
||||||
|
|
||||||
if (!$connection->multi_query($query)) {
|
if (!$connection->multi_query($query)) {
|
||||||
|
|
|
@ -907,7 +907,7 @@ function input($field, $value, $function) {
|
||||||
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
|
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
|
||||||
}
|
}
|
||||||
echo "<textarea$attrs>" . h($value) . '</textarea>';
|
echo "<textarea$attrs>" . h($value) . '</textarea>';
|
||||||
} elseif ($function == "json") {
|
} elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
|
||||||
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
|
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
|
||||||
} else {
|
} else {
|
||||||
// int(3) is only a display hint
|
// int(3) is only a display hint
|
||||||
|
|
Loading…
Reference in a new issue