Fix SQL command toggle
This commit is contained in:
parent
80d030f51a
commit
cc268428b8
|
@ -598,7 +598,7 @@ class Adminer {
|
||||||
}
|
}
|
||||||
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
|
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
|
||||||
return " <span class='time'>" . @date("H:i:s") . "</span>" // @ - time zone may be not set
|
return " <span class='time'>" . @date("H:i:s") . "</span>" // @ - time zone may be not set
|
||||||
. " <a href='#$id'>" . lang('SQL command') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "")
|
. " <a href='#$id' class='toggle'>" . lang('SQL command') . "</a>"
|
||||||
. "<div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre>'
|
. "<div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre>'
|
||||||
. ($time ? " <span class='time'>($time)</span>" : '')
|
. ($time ? " <span class='time'>($time)</span>" : '')
|
||||||
. (support("sql") ? '<p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a>' : '')
|
. (support("sql") ? '<p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a>' : '')
|
||||||
|
|
|
@ -137,7 +137,7 @@ function page_messages($error) {
|
||||||
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
|
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
|
||||||
$messages = $_SESSION["messages"][$uri];
|
$messages = $_SESSION["messages"][$uri];
|
||||||
if ($messages) {
|
if ($messages) {
|
||||||
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>\n";
|
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>" . script("messagesPrint();");
|
||||||
unset($_SESSION["messages"][$uri]);
|
unset($_SESSION["messages"][$uri]);
|
||||||
}
|
}
|
||||||
if ($error) {
|
if ($error) {
|
||||||
|
|
|
@ -618,7 +618,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
|
||||||
$sql = $adminer->messageQuery($query, $time);
|
$sql = $adminer->messageQuery($query, $time);
|
||||||
}
|
}
|
||||||
if ($failed) {
|
if ($failed) {
|
||||||
$error = error() . $sql;
|
$error = error() . $sql . script("messagesPrint();");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($redirect) {
|
if ($redirect) {
|
||||||
|
|
|
@ -60,6 +60,15 @@ function typePassword(el, disable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Install toggle handler
|
||||||
|
*/
|
||||||
|
function messagesPrint() {
|
||||||
|
var els = qsa('.toggle', document);
|
||||||
|
for (var i = 0; i < els.length; i++) {
|
||||||
|
els[i].onclick = partial(toggle, els[i].getAttribute('href').substr(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var dbCtrl;
|
var dbCtrl;
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
// Editor specific functions
|
// Editor specific functions
|
||||||
|
|
||||||
|
function messagesPrint() {
|
||||||
|
}
|
||||||
|
|
||||||
function selectFieldChange() {
|
function selectFieldChange() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue