]> git.joonet.de Git - adminer.git/commitdiff
Unselect original after value input
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 28 Jul 2009 15:52:39 +0000 (15:52 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 28 Jul 2009 15:52:39 +0000 (15:52 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@935 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/adminer.inc.php
adminer/include/functions.inc.php
editor/include/adminer.inc.php

index 529f24d0e331f0a27ae1990b75a32aae2fd34e6d..f835ab5a0446167f55eb9715f4137be218416157 100644 (file)
@@ -371,7 +371,7 @@ class Adminer {
                if ($field["null"] || isset($_GET["default"])) {
                        array_unshift($return, "NULL");
                }
-               return (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $return;
+               return $return;
        }
        
        /** Get options to display edit field
index aeda28de4169933fcca7cf6521ebe85e3e2241ce..587b5abc1b1863d4ef01d7bd37bcfa6a8e3c77d9 100644 (file)
@@ -303,8 +303,8 @@ function input($field, $value, $function) {
                        echo ' <label><input type="radio" name="fields[' . $name . ']" value="' . (isset($_GET["default"]) ? (strlen($val) ? htmlspecialchars($val) : " ") : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . '>' . htmlspecialchars($val) . '</label>';
                }
        } else {
-               $functions = $adminer->editFunctions($field);
-               $first = array_search("", $functions);
+               $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
+               $first = array_search("", $functions) + (isset($_GET["select"]) ? 1 : 0);
                $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, $function) . '</select>' : "&nbsp;") . '<td>';
                $input = $adminer->editInput($_GET["edit"], $field, ' name="fields[' . $name . ']"' . $onchange, $value); // usage in call is without a table
@@ -315,12 +315,12 @@ function input($field, $value, $function) {
                        foreach ($matches[1] as $i => $val) {
                                $val = stripcslashes(str_replace("''", "'", $val));
                                $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
-                               echo ' <label><input type="checkbox" name="fields[' . $name . '][' . $i . ']" value="' . (isset($_GET["default"]) ? htmlspecialchars($val) : 1 << $i) . '"' . ($checked ? ' checked="checked"' : '') . $onchange . '>' . htmlspecialchars($val) . '</label>';
+                               echo ' <label><input type="checkbox" name="fields[' . $name . '][' . $i . ']" value="' . (isset($_GET["default"]) ? htmlspecialchars($val) : 1 << $i) . '"' . ($checked ? ' checked="checked"' : '') . "$onchange>" . htmlspecialchars($val) . '</label>';
                        }
                } elseif (strpos($field["type"], "text") !== false) {
-                       echo '<textarea name="fields[' . $name . ']" cols="50" rows="12"' . $onchange . '>' . htmlspecialchars($value) . '</textarea>';
+                       echo '<textarea name="fields[' . $name . ']" cols="50" rows="12"' . "$onchange>" . htmlspecialchars($value) . '</textarea>';
                } elseif (ereg('binary|blob', $field["type"])) {
-                       echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . '>' : lang('File uploads are disabled.'));
+                       echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . "$onchange>" : lang('File uploads are disabled.'));
                } else {
                        // int(3) is only a display hint
                        $maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
index 81262ccce4f669fb9f364a2328ef4a30d83cbfb9..38bba839a6717696e25d9c5eea59440779e9d693 100644 (file)
@@ -285,7 +285,7 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
        }
        
        function editFunctions($field) {
-               return (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + array("");
+               return array("");
        }
        
        function editInput($table, $field, $attrs, $value) {