From 99039467172d515f2b2078848ad8691a4d4e96cf Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 8 Sep 2009 08:13:39 +0000 Subject: [PATCH] Use original values in Editor multi edit git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1071 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/functions.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index af71b8ca..f7004eef 100644 --- a/adminer/include/functions.inc.php +++ b/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 ? "" : nbsp($functions[0])) . ''; + echo (count($functions) > 1 ? "" : nbsp($functions[0])) . ''; $input = $adminer->editInput($_GET["edit"], $field, " name='fields[$name]'$onchange", $value); // usage in call is without a table if (strlen($input)) { echo $input;