mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 01:24:17 +02:00
Respect original values in mass edit and clone
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@677 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -47,8 +47,8 @@ if ($_POST["save"]) {
|
|||||||
} elseif ($where) {
|
} elseif ($where) {
|
||||||
$select = array();
|
$select = array();
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $field) {
|
||||||
if (isset($field["privileges"]["select"]) && (!$_POST["clone"] || !$field["auto_increment"])) {
|
if (isset($field["privileges"]["select"])) {
|
||||||
$select[] = ($field["type"] == "enum" || $field["type"] == "set" ? "1*" . idf_escape($name) . " AS " : "") . idf_escape($name);
|
$select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : ($field["type"] == "enum" || $field["type"] == "set" ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$row = array();
|
$row = array();
|
||||||
@@ -67,7 +67,7 @@ if ($fields) {
|
|||||||
echo "<table cellspacing='0'>\n";
|
echo "<table cellspacing='0'>\n";
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $field) {
|
||||||
echo "<tr><th>" . htmlspecialchars($name) . "</th>";
|
echo "<tr><th>" . htmlspecialchars($name) . "</th>";
|
||||||
$value = (!isset($row) ? ($_POST["clone"] && $field["auto_increment"] ? "" : $field["default"])
|
$value = (!isset($row) ? ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : null))
|
||||||
: (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
|
: (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
|
||||||
);
|
);
|
||||||
input($name, $field, $value);
|
input($name, $field, $value);
|
||||||
|
1
todo.txt
1
todo.txt
@@ -10,6 +10,7 @@ Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.ph
|
|||||||
Utilize information_schema.USER_PRIVILEGES in Privileges
|
Utilize information_schema.USER_PRIVILEGES in Privileges
|
||||||
Highlight SQL textarea - may use external CodePress
|
Highlight SQL textarea - may use external CodePress
|
||||||
Column and table names auto-completition in SQL textarea
|
Column and table names auto-completition in SQL textarea
|
||||||
|
Mass editation of individual rows
|
||||||
? Save token also to cookie - for session expiration and login in other window
|
? Save token also to cookie - for session expiration and login in other window
|
||||||
? Save uploaded files after error to session variable instead of hidden field
|
? Save uploaded files after error to session variable instead of hidden field
|
||||||
? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB, JS packer can save 1 KB
|
? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB, JS packer can save 1 KB
|
||||||
|
Reference in New Issue
Block a user