mirror of
https://github.com/vrana/adminer.git
synced 2025-08-05 14:17:26 +02:00
Align numbers right (bug #912)
This commit is contained in:
@@ -90,7 +90,8 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
if ($link) {
|
||||
$val = "<a href='" . h($link) . "'" . (is_url($link) ? target_blank() : '') . ">$val</a>";
|
||||
}
|
||||
echo "<td>$val";
|
||||
// https://dev.mysql.com/doc/dev/mysql-server/latest/field__types_8h.html
|
||||
echo "<td" . ($types[$key] <= 9 || $types[$key] == 246 ? " class='number'" : "") . ">$val";
|
||||
}
|
||||
}
|
||||
echo ($i ? "</table>\n</div>" : "<p class='message'>" . lang('No rows.')) . "\n";
|
||||
|
@@ -453,7 +453,7 @@ if (!$columns && support("table")) {
|
||||
$value = $_POST["val"][$unique_idf][bracket_escape($key)];
|
||||
$editable = !is_array($row[$key]) && is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"];
|
||||
$text = preg_match('~text|json|lob~', $field["type"]);
|
||||
echo "<td id='$id'";
|
||||
echo "<td id='$id'" . (preg_match(number_type(), $field["type"]) ? " class='number'" : "");
|
||||
if (($_GET["modify"] && $editable) || $value !== null) {
|
||||
$h_value = h($value !== null ? $value : $row[$key]);
|
||||
echo ">" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>");
|
||||
|
@@ -1,4 +1,5 @@
|
||||
Adminer dev:
|
||||
Align numbers right (bug #912)
|
||||
CSS: Dark mode syntax highlighting
|
||||
SQL textarea: Open help on Ctrl+click
|
||||
Designs named adminer-dark.css use dark basic style
|
||||
|
@@ -213,9 +213,8 @@ ORDER BY ORDINAL_POSITION", null, "") as $row //! requires MySQL 5
|
||||
if ($link) {
|
||||
$return = "<a href='$link'" . (is_url($link) ? target_blank() : "") . ">$return</a>";
|
||||
}
|
||||
if (!$link && !like_bool($field) && preg_match(number_type(), $field["type"])) {
|
||||
$return = "<div class='number'>$return</div>"; // Firefox doesn't support <colgroup>
|
||||
} elseif (preg_match('~date~', $field["type"])) {
|
||||
// Firefox doesn't support <colgroup>
|
||||
if (preg_match('~date~', $field["type"])) {
|
||||
$return = "<div class='datetime'>$return</div>";
|
||||
}
|
||||
return $return;
|
||||
|
Reference in New Issue
Block a user