diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 2cc6db67..368b116d 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -127,7 +127,7 @@ if (isset($rights["insert"])) { $set = ""; foreach ((array) $_GET["where"] as $val) { if (count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "=" - || ($val["op"] == "" && !ereg('[_%]', $val["val"])) // LIKE in Editor + || (!$val["op"] && !ereg('[_%]', $val["val"])) // LIKE in Editor )) { $set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]); } @@ -198,20 +198,21 @@ if (!$columns) { echo "" . checkbox("check[]", $unique_idf, in_array($unique_idf, (array) $_POST["check"]), "", "this.form['all'].checked = false; form_uncheck('all-page');") . (count($select) != count($group) || information_schema(DB) ? '' : " " . lang('edit') . ""); foreach ($row as $key => $val) { if (isset($names[$key])) { + $field = $fields[$key]; if (strlen($val) && (!isset($email_fields[$key]) || strlen($email_fields[$key]))) { $email_fields[$key] = (is_email($val) ? $names[$key] : ""); //! filled e-mails may be contained on other pages } $link = ""; - $val = $adminer->editVal($val, $fields[$key]); + $val = $adminer->editVal($val, $field); if (!isset($val)) { $val = "NULL"; } else { - if (ereg('blob|binary', $fields[$key]["type"]) && strlen($val)) { + if (ereg('blob|binary', $field["type"]) && strlen($val)) { $link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . "&$unique_idf"); } if (!strlen($val)) { $val = " "; - } elseif (strlen($text_length) && ereg('blob|text', $fields[$key]["type"]) && is_utf8($val)) { + } elseif (strlen($text_length) && ereg('text|blob', $field["type"]) && is_utf8($val)) { $val = whitespace(shorten_utf8($val, max(0, intval($text_length)))); // usage of LEFT() would reduce traffic but complicate query } else { $val = whitespace(h($val)); @@ -232,7 +233,7 @@ if (!$columns) { if (!$link && is_email($val)) { $link = "mailto:$val"; } - $val = $adminer->selectVal($val, $link, $fields[$key]); + $val = $adminer->selectVal($val, $link, $field); echo "$val"; } } diff --git a/adminer/static/default.css b/adminer/static/default.css index b9ba678d..2c1b3e3a 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -30,6 +30,7 @@ tr:hover td, tr:hover th { background: #ddf; } .odd td { background: #F5F5F5; } .time { color: silver; font-size: 70%; float: right; margin-top: -3em; } .function { text-align: right; } +.number { text-align: right; } .type { width: 15ex; width: auto\9; } #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; } #menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; } diff --git a/changes.txt b/changes.txt index 46c0d654..9c27f336 100644 --- a/changes.txt +++ b/changes.txt @@ -6,6 +6,7 @@ Display number of manipulated rows in JS confirm E-mail attachments (Editor) Optional year in date (Editor) Search operators (Editor) +Align numbers to right in select (Editor) Move

to $adminer->navigation (customization) Rename get_dbh to connection (customization) diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index e67edff3..5715cf0c 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -147,7 +147,13 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5 if ($field["full_type"] == "tinyint(1)" && $return != " ") { // bool $return = '' . h($val) . ''; } - return ($link ? "$return" : $return); + if ($link) { + $return = "$return"; + } + if (!$link && $field["full_type"] != "tinyint(1)" && ereg('int|float|double|decimal', $field["type"])) { + $return = "
$return
"; // Firefox doesn't support + } + return $return; } function editVal($val, $field) {