Generalize inline edit of long fields

This commit is contained in:
Jakub Vrana 2014-01-08 23:14:53 -08:00
parent a7d475e3e7
commit cff70ad1df

View file

@ -39,7 +39,12 @@ if ($_GET["val"] && is_ajax()) {
header("Content-Type: text/plain; charset=utf-8");
foreach ($_GET["val"] as $unique_idf => $row) {
$as = convert_field($fields[key($row)]);
echo $connection->result("SELECT" . limit(($as ? $as : idf_escape(key($row))) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1));
$select = array($as ? $as : idf_escape(key($row)));
$where[] = where_check($unique_idf, $fields);
$return = $driver->select($TABLE, $select, $where, $select, array(), 1, 0);
if ($return) {
echo reset($return->fetch_row());
}
}
exit;
}