Permalink
Browse files

Hide NULL in Editor enum

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1180 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 4b3d569 commit 67584771dc92aceee7291fc2fa6bf72b656855c2 jakubvrana committed Oct 9, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 adminer/include/functions.inc.php
@@ -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) {

0 comments on commit 6758477

Please sign in to comment.