Adding | to separate action links for better readability

This commit is contained in:
Lionel Laffineur 2023-07-14 22:19:15 +02:00
parent 73ea54a2c4
commit 493de37977
4 changed files with 11 additions and 10 deletions

View file

@ -157,7 +157,8 @@ if ($adminer->homepage()) {
}
echo '<p class="links"><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
echo (support("view") ? '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n" : "");
echo (support("view") ? ' | <a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n" : "");
echo '</p>';
if (support("routine")) {
echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n";

View file

@ -193,7 +193,7 @@ class Adminer {
$name = $tableStatus["Name"];
foreach ($links as $key => $val) {
if ($key !== array_key_first($links)) {
echo "|";
echo " | ";
}
echo " <a href='" . h(ME) . "$key=" . urlencode($name) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
}
@ -243,7 +243,7 @@ class Adminer {
}
return "<p class='links'><code class='jush-$jush copy-to-clipboard'>" . h(str_replace("\n", " ", $query)) . "</code> <span class='time'>(" . format_time($start) . ")</span>"
. (support("sql") ? " <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" : "")
. " <a href='#' class='copy-to-clipboard'>" . lang('Copy to clipboard') . "</a>"
. " | <a href='#' class='copy-to-clipboard'>" . lang('Copy to clipboard') . "</a>"
. $return
;
}
@ -658,7 +658,7 @@ class Adminer {
return " <span class='time'>" . @date("H:i:s") . "</span>" // @ - time zone may be not set
. " $return<div id='$sql_id' class='hidden'><pre><code class='jush-$jush copy-to-clipboard'>" . shorten_utf8($query, 1000) . "</code></pre>"
. ($time ? " <span class='time'>($time)</span>" : '')
. (support("sql") ? '<p class="links"><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a> <a href="#" class="copy-to-clipboard">' . lang('Copy to clipboard') . '</a>' : '')
. (support("sql") ? '<p class="links"><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a> | <a href="#" class="copy-to-clipboard">' . lang('Copy to clipboard') . '</a>' : '')
. '</div>'
;
}
@ -992,13 +992,13 @@ bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\d\.?\d).*~s', '
}
$this->databasesPrint($missing);
if (DB == "" || !$missing) {
echo "<p class='links'>" . (support("sql") ? "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"]) && !isset($_GET["import"])) . ">" . lang('SQL command') . "</a>\n<a href='" . h(ME) . "import='" . bold(isset($_GET["import"])) . ">" . lang('Import') . "</a>\n" : "") . "";
echo "<p class='links'>" . (support("sql") ? "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"]) && !isset($_GET["import"])) . ">" . lang('SQL command') . "</a>\n | <a href='" . h(ME) . "import='" . bold(isset($_GET["import"])) . ">" . lang('Import') . "</a>\n" : "") . "";
if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>\n";
echo " | <a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>\n";
}
}
if ($_GET["ns"] !== "" && !$missing && DB != "") {
echo '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>\n";
echo '<br><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>\n";
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {

View file

@ -98,7 +98,7 @@ if (!$error && $_POST) {
$q = substr($query, 0, $pos);
$commands++;
$print = "<pre id='sql-$commands'><code class='jush-$jush copy-to-clipboard'>" . $adminer->sqlCommandQuery($q) . "</code></pre>\n";
$print .= "<a href='#' class='copy-to-clipboard'>" . lang('Copy to clipboard') . "</a>";
$print .= " | <a href='#' class='copy-to-clipboard'>" . lang('Copy to clipboard') . "</a>";
if ($jush == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) {
// PHP doesn't support setting SQLITE_LIMIT_ATTACHED
echo $print;

View file

@ -24,7 +24,7 @@ code { background: #eee; }
tbody tr:hover td, tbody tr:hover th { background: #eee; }
pre { margin: 1em 0 0; }
pre, textarea { font: 100%/1.25 monospace; }
input { vertical-align: middle; border-radius: 5px; padding: 2px; }
input, button { vertical-align: middle; border-radius: 5px; padding: 2px; }
input.default { box-shadow: 1px 1px 1px #777; }
input.required { box-shadow: 1px 1px 1px red; }
input.maxlength { box-shadow: 1px 1px 1px red; }
@ -64,7 +64,7 @@ select { border-radius: 5px; padding: 2px; vertical-align: middle;; }
.footer { position: sticky; bottom: 0; margin-right: -20px; border-top: 20px solid rgba(255, 255, 255, .7); border-image: linear-gradient(rgba(255, 255, 255, .2), #fff) 100% 0; }
.footer > div { background: #fff; padding: 0 0 .5em; }
.footer fieldset { margin-top: 0; }
.links a { white-space: nowrap; margin-right: 5px; }
.links a { white-space: nowrap; }
.logout { margin-top: .5em; position: absolute; top: 0; right: 0; }
.loadmore { margin-left: 1ex; }
/* .edit used in designs */