diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 736889eb..2dc4b698 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -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"] return " " . @date("H:i:s") . "" // @ - time zone may be not set - . " " . lang('SQL command') . "" . script("qsl('a').onclick = partial(toggle, '$id');", "") + . " " . lang('SQL command') . "" . "
" . shorten_utf8($query, 1000) . '
'
. ($time ? " ($time)" : '')
. (support("sql") ? '' . lang('Edit') . '' : '') diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index eea72ed0..63bdd772 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -137,7 +137,7 @@ function page_messages($error) { $uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]); $messages = $_SESSION["messages"][$uri]; if ($messages) { - echo "
\n \n"; + echo " \n " . script("messagesPrint();"); unset($_SESSION["messages"][$uri]); } if ($error) { diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 44722724..7975846a 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -618,7 +618,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute $sql = $adminer->messageQuery($query, $time); } if ($failed) { - $error = error() . $sql; + $error = error() . $sql . script("messagesPrint();"); return false; } if ($redirect) { diff --git a/adminer/static/editing.js b/adminer/static/editing.js index b0cbb517..f3d96479 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -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; diff --git a/editor/static/editing.js b/editor/static/editing.js index ac876475..5b3a7b93 100644 --- a/editor/static/editing.js +++ b/editor/static/editing.js @@ -1,5 +1,8 @@ // Editor specific functions +function messagesPrint() { +} + function selectFieldChange() { }