Edit json and jsonb types in textarea

This commit is contained in:
Kakysha 2015-09-15 01:34:01 +03:00 committed by Jakub Vrana
parent 842ea0bd46
commit 4a69059e1b
2 changed files with 2 additions and 2 deletions

View file

@ -29,7 +29,7 @@ if (!$error && $_POST) {
$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";
if (!$connection->multi_query($query)) {

View file

@ -907,7 +907,7 @@ function input($field, $value, $function) {
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
}
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>';
} else {
// int(3) is only a display hint