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

Deferred operations by AJAX instead of JS (doesn't require sending token)

This commit is contained in:
Jakub Vrana
2010-10-19 01:40:49 +02:00
parent c5ee9778b4
commit c313dd83a2
5 changed files with 43 additions and 14 deletions

View File

@@ -482,6 +482,25 @@ function odd($return = ' class="odd"') {
return ($i++ % 2 ? $return : '');
}
/** Print one row in JSON object
* @param string or "" to close the object
* @param string
* @return null
*/
function json_row($key, $val = null) {
static $first = true;
if ($first) {
echo "{";
}
if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, '\\"') . '": ' . (isset($val) ? '"' . addcslashes($val, '\\"') . '"' : 'undefined');
$first = false;
} else {
echo "\n}\n";
$first = true;
}
}
/** Check whether the string is in UTF-8
* @param string
* @return bool