]> git.joonet.de Git - adminer.git/commitdiff
Hide NULL in Editor enum
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 9 Oct 2009 16:19:40 +0000 (16:19 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 9 Oct 2009 16:19:40 +0000 (16:19 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1180 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/functions.inc.php

index 1814c2771d521e6c4387c7c38f5c744b41e6223e..304bc1acaff3a9651e6252cfe8c64a82ae9c4428 100644 (file)
@@ -396,10 +396,11 @@ function input($field, $value, $function) {
        global $types, $adminer;
        $name = h(bracket_escape($field["field"]));
        echo "<td class='function'>";
+       $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
        if ($field["type"] == "enum") {
-               echo "&nbsp;<td>" . (isset($_GET["select"]) ? " <label><input type='radio' name='fields[$name]' value='-1' checked><em>" . lang('original') . "</em></label>" : "");
-               if ($field["null"]) {
-                       echo " <label><input type='radio' name='fields[$name]' value=''" . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked') . '>' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
+               echo "&nbsp;<td>" . ($functions["orig"] ? "<label><input type='radio' name='fields[$name]' value='-1' checked><em>$functions[orig]</em></label> " : "");
+               if (in_array("NULL", $functions)) {
+                       echo "<label><input type='radio' name='fields[$name]' value=''" . (isset($value) || $functions["orig"] ? '' : ' checked') . "><em>NULL</em></label> ";
                }
                echo "<input type='radio' name='fields[$name]' value='0'" . ($value === 0 ? ' checked' : '') . '>';
                preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
@@ -409,7 +410,6 @@ function input($field, $value, $function) {
                        echo " <label><input type='radio' name='fields[$name]' value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
                }
        } else {
-               $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
                $first = 0;
                foreach ($functions as $key => $val) {
                        if ($key === "" || !$val) {