From 6d3b5935eb55348b4a89a08c7643e2ca0b4e3d94 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sun, 31 May 2009 19:54:30 +0000 Subject: [PATCH] Separate function and value git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@632 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- call.inc.php | 2 +- default.css | 1 + edit.inc.php | 2 +- include/editing.inc.php | 11 ++++------- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/call.inc.php b/call.inc.php index 715a1251..8974d946 100644 --- a/call.inc.php +++ b/call.inc.php @@ -52,7 +52,7 @@ if ($in) { echo "\n"; foreach ($in as $key) { $field = $routine["fields"][$key]; - echo ""; $value = $_POST["fields"][$key]; if (strlen($value) && ($field["type"] == "enum" || $field["type"] == "set")) { $value = intval($value); diff --git a/default.css b/default.css index de119045..e3d4c7ac 100644 --- a/default.css +++ b/default.css @@ -23,6 +23,7 @@ code { background: #eee; } .binary { color: red; } .odd td { background: #F5F5F5; } .time { color: Silver; font-size: 70%; float: right; margin-top: -3em; } +.function { text-align: right; } tr:hover td { background: #ddf; } thead tr:hover td { background: transparent; } #menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; } diff --git a/edit.inc.php b/edit.inc.php index 3db1db00..c1963a52 100644 --- a/edit.inc.php +++ b/edit.inc.php @@ -66,7 +66,7 @@ if ($fields) { unset($create); echo "
" . htmlspecialchars($field["field"]) . ""; + echo "
" . htmlspecialchars($field["field"]) . "
\n"; foreach ($fields as $name => $field) { - echo ""; $value = (!isset($row) ? $field["default"] : (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : ($_POST["clone"] && $field["auto_increment"] ? "" : diff --git a/include/editing.inc.php b/include/editing.inc.php index 4d207460..d71228f3 100644 --- a/include/editing.inc.php +++ b/include/editing.inc.php @@ -1,11 +1,10 @@
" . htmlspecialchars($name) . ""; + echo "
" . htmlspecialchars($name) . "") { //! pass empty separator if there are no functions in the whole table global $types; $name = htmlspecialchars(bracket_escape($name)); + echo ""; if ($field["type"] == "enum") { - if (isset($_GET["select"])) { - echo ' '; - } + echo $separator . (isset($_GET["select"]) ? ' ' : ""); if ($field["null"] || isset($_GET["default"])) { echo ' '; } @@ -33,9 +32,7 @@ function input($name, $field, $value) { if ($field["null"] || isset($_GET["default"])) { array_unshift($options, "NULL"); } - if (count($options) > 1 || isset($_GET["select"])) { - echo ''; - } + echo (count($options) > 1 || isset($_GET["select"]) ? '' : "") . $separator; if ($field["type"] == "set") { //! 64 bits preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches); foreach ($matches[1] as $i => $val) {