Align numbers to right in select
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1149 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
83e8bac503
commit
a1609c79ac
|
@ -127,7 +127,7 @@ if (isset($rights["insert"])) {
|
||||||
$set = "";
|
$set = "";
|
||||||
foreach ((array) $_GET["where"] as $val) {
|
foreach ((array) $_GET["where"] as $val) {
|
||||||
if (count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "="
|
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"]);
|
$set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]);
|
||||||
}
|
}
|
||||||
|
@ -198,20 +198,21 @@ if (!$columns) {
|
||||||
echo "<tr" . odd() . "><td>" . 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) ? '' : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . "&$unique_idf") . "'>" . lang('edit') . "</a>");
|
echo "<tr" . odd() . "><td>" . 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) ? '' : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . "&$unique_idf") . "'>" . lang('edit') . "</a>");
|
||||||
foreach ($row as $key => $val) {
|
foreach ($row as $key => $val) {
|
||||||
if (isset($names[$key])) {
|
if (isset($names[$key])) {
|
||||||
|
$field = $fields[$key];
|
||||||
if (strlen($val) && (!isset($email_fields[$key]) || strlen($email_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
|
$email_fields[$key] = (is_email($val) ? $names[$key] : ""); //! filled e-mails may be contained on other pages
|
||||||
}
|
}
|
||||||
$link = "";
|
$link = "";
|
||||||
$val = $adminer->editVal($val, $fields[$key]);
|
$val = $adminer->editVal($val, $field);
|
||||||
if (!isset($val)) {
|
if (!isset($val)) {
|
||||||
$val = "<i>NULL</i>";
|
$val = "<i>NULL</i>";
|
||||||
} else {
|
} 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");
|
$link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . "&$unique_idf");
|
||||||
}
|
}
|
||||||
if (!strlen($val)) {
|
if (!strlen($val)) {
|
||||||
$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
|
$val = whitespace(shorten_utf8($val, max(0, intval($text_length)))); // usage of LEFT() would reduce traffic but complicate query
|
||||||
} else {
|
} else {
|
||||||
$val = whitespace(h($val));
|
$val = whitespace(h($val));
|
||||||
|
@ -232,7 +233,7 @@ if (!$columns) {
|
||||||
if (!$link && is_email($val)) {
|
if (!$link && is_email($val)) {
|
||||||
$link = "mailto:$val";
|
$link = "mailto:$val";
|
||||||
}
|
}
|
||||||
$val = $adminer->selectVal($val, $link, $fields[$key]);
|
$val = $adminer->selectVal($val, $link, $field);
|
||||||
echo "<td>$val";
|
echo "<td>$val";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ tr:hover td, tr:hover th { background: #ddf; }
|
||||||
.odd td { background: #F5F5F5; }
|
.odd td { background: #F5F5F5; }
|
||||||
.time { color: silver; font-size: 70%; float: right; margin-top: -3em; }
|
.time { color: silver; font-size: 70%; float: right; margin-top: -3em; }
|
||||||
.function { text-align: right; }
|
.function { text-align: right; }
|
||||||
|
.number { text-align: right; }
|
||||||
.type { width: 15ex; width: auto\9; }
|
.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 { 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; }
|
#menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
|
||||||
|
|
|
@ -6,6 +6,7 @@ Display number of manipulated rows in JS confirm
|
||||||
E-mail attachments (Editor)
|
E-mail attachments (Editor)
|
||||||
Optional year in date (Editor)
|
Optional year in date (Editor)
|
||||||
Search operators (Editor)
|
Search operators (Editor)
|
||||||
|
Align numbers to right in select (Editor)
|
||||||
Move <h1> to $adminer->navigation (customization)
|
Move <h1> to $adminer->navigation (customization)
|
||||||
Rename get_dbh to connection (customization)
|
Rename get_dbh to connection (customization)
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,13 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
||||||
if ($field["full_type"] == "tinyint(1)" && $return != " ") { // bool
|
if ($field["full_type"] == "tinyint(1)" && $return != " ") { // bool
|
||||||
$return = '<img src="' . ($val ? "../adminer/static/plus.gif" : "../adminer/static/cross.gif") . '" alt="' . h($val) . '">';
|
$return = '<img src="' . ($val ? "../adminer/static/plus.gif" : "../adminer/static/cross.gif") . '" alt="' . h($val) . '">';
|
||||||
}
|
}
|
||||||
return ($link ? "<a href='$link'>$return</a>" : $return);
|
if ($link) {
|
||||||
|
$return = "<a href='$link'>$return</a>";
|
||||||
|
}
|
||||||
|
if (!$link && $field["full_type"] != "tinyint(1)" && ereg('int|float|double|decimal', $field["type"])) {
|
||||||
|
$return = "<div class='number'>$return</div>"; // Firefox doesn't support <colgroup>
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function editVal($val, $field) {
|
function editVal($val, $field) {
|
||||||
|
|
Loading…
Reference in a new issue