From 5fe25fca67413018246403bb6e6e48e52752800a Mon Sep 17 00:00:00 2001
From: Peter Knut
Date: Wed, 14 Aug 2024 01:17:04 +0200
Subject: [PATCH] Improve readability of the code for the query block
---
adminer/include/adminer.inc.php | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index 82315054..912e9593 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -231,17 +231,25 @@ class Adminer {
*/
function selectQuery($query, $start, $failed = false) {
global $jush, $driver;
- $return = "
\n"; // required for IE9 inline edit
+
+ $supportSql = support("sql");
+
+ $result = ""
+ . "" . h(str_replace("\n", " ", $query)) . " "
+ . "(" . format_time($start) . ")"
+ . ($supportSql ? " " . lang('Edit') . "" : "");
+
if (!$failed && ($warnings = $driver->warnings())) {
$id = "warnings";
- $return = ", " . lang('Warnings') . "" . script("qsl('a').onclick = partial(toggle, '$id');", "")
- . "$return
\n$warnings
\n"
- ;
+ $result = ($supportSql ? "," : "")
+ . " " . lang('Warnings') . "" . script("qsl('a').onclick = partial(toggle, '$id');", "")
+ . "\n"
+ . "\n$warnings
\n";
+ } else {
+ $result .= "\n";
}
- return "" . h(str_replace("\n", " ", $query)) . " (" . format_time($start) . ")"
- . (support("sql") ? " " . lang('Edit') . "" : "")
- . $return
- ;
+
+ return $result;
}
/** Query printed in SQL command before execution