diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index b4f6eb04..3c822536 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -232,7 +232,9 @@ $translations = array( 'last' => 'poslední', 'Network' => 'Síť', 'Geometry' => 'Geometrie', - 'Double click on a field to edit it.' => 'Dvojklikněte na políčko, které chcete editovat.', 'Databases have been dropped.' => 'Databáze byly odstraněny.', 'File exists.' => 'Soubor existuje.', + 'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.', + 'Increase text length to modify this value.' => 'Ke změně této hodnoty zvyšte délku textů.', + 'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.', ); diff --git a/adminer/select.inc.php b/adminer/select.inc.php index bf8bab2a..3a890772 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -111,9 +111,10 @@ if ($_POST && !$error) { foreach ($_POST["val"] as $unique_idf => $row) { $set = array(); foreach ($row as $key => $val) { - $set[] = idf_escape(bracket_escape($key, 1)) . " = " . $connection->quote($val); // 1 - back //! $adminer->editVal($val) + $key = bracket_escape($key, 1); + $set[] = idf_escape($key) . " = " . $connection->quote($adminer->editVal($val, $fields[$key])); // 1 - back } - $result = queries("UPDATE " . idf_escape($TABLE) . " SET " . implode(", ", $set) . " WHERE " . where_check($unique_idf)); + $result = queries("UPDATE" . limit1(idf_escape($TABLE) . " SET " . implode(", ", $set) . " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key if (!$result) { break; } @@ -229,6 +230,7 @@ if (!$columns) { echo "\n"; echo "
" . lang('edit') . ""; $names = array(); + $functions = array(); reset($select); $order = 1; foreach ($rows[0] as $key => $val) { @@ -240,6 +242,7 @@ if (!$columns) { $names[$key] = $name; echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions } + $functions[$key] = $val["fun"]; next($select); } $lengths = array(); @@ -313,11 +316,12 @@ if (!$columns) { $id = h("val[$unique_idf][" . bracket_escape($key) . "]"); $value = $_POST["val"][$unique_idf][bracket_escape($key)]; $h_value = h(isset($value) ? $value : $row[$key]); - $editable = is_utf8($val) && !strpos($val, "..."); //! function results, not unique key + $long = strpos($val, "..."); + $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key]; $text = ereg('text|blob', $field["type"]); echo (($_GET["modify"] && $editable) || isset($value) ? "" . ($text ? "" : "") - : "" . $adminer->selectVal($val, $link, $field) + : "" . $adminer->selectVal($val, $link, $field) ); } } @@ -357,7 +361,7 @@ if (!$columns) { if (!information_schema(DB)) { ?>
- onclick="if (!selectDblClicked) { alert(''); return false; };"> + onclick="if (!selectDblClicked) { alert(''); return false; };">