Use original values in Editor multi edit

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1071 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-09-08 08:13:39 +00:00
parent 24fc853e7b
commit 9903946717

View file

@ -437,9 +437,15 @@ function input($field, $value, $function) {
}
} else {
$functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$first = array_search("", $functions) + (isset($_GET["select"]) ? 1 : 0);
$first = 0;
foreach ($functions as $key => $val) {
if ($key === "" || !$val) {
break;
}
$first++;
}
$onchange = ($first ? " onchange=\"var f = this.form['function[" . addcslashes($name, "\r\n'\\") . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
echo (count($functions) > 1 ? "<select name='function[$name]'>" . optionlist($functions, in_array($function, $functions) ? $function : "") . "</select>" : nbsp($functions[0])) . '<td>';
echo (count($functions) > 1 ? "<select name='function[$name]'>" . optionlist($functions, !isset($function) || in_array($function, $functions) ? $function : "") . "</select>" : nbsp($functions[0])) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, " name='fields[$name]'$onchange", $value); // usage in call is without a table
if (strlen($input)) {
echo $input;