Browse files

Use original values in Editor multi edit

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1071 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 24fc853 commit 99039467172d515f2b2078848ad8691a4d4e96cf jakubvrana committed Sep 8, 2009
Showing with 8 additions and 2 deletions.
  1. +8 −2 adminer/include/functions.inc.php
View
10 adminer/include/functions.inc.php
@@ -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;

0 comments on commit 9903946

Please sign in to comment.