]> git.joonet.de Git - adminer.git/commitdiff
Return false from toggle()
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 12:09:30 +0000 (13:09 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 16:09:41 +0000 (17:09 +0100)
adminer/include/adminer.inc.php
adminer/include/functions.inc.php
adminer/sql.inc.php
adminer/static/functions.js

index 4b9bec0cf8918b8f4e995c45365c8f8bc36b1638..1e6b00a99df69aa46292e5b1af52cbc95969418b 100644 (file)
@@ -584,7 +584,7 @@ focus(qs('#username'));
                        $query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
                }
                $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> <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a>" // @ - time zone may be not set
+               return " <span class='time'>" . @date("H:i:s") . "</span> <a href='#$id' onclick=\"return toggle('$id');\">" . lang('SQL command') . "</a>" // @ - time zone may be not set
                        . "<div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre>'
                        . ($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>' : '')
index 451bd2c8a1bd48c42cab682753aa65e702ac5f5f..0953e52df2b9da71cfc7949ce6eb247331ebe027 100644 (file)
@@ -202,7 +202,7 @@ function confirm() {
 * @return null
 */
 function print_fieldset($id, $legend, $visible = false, $onclick = "") {
-       echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"" . h($onclick) . "return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
+       echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"" . h($onclick) . "return toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
 }
 
 /** Return class='active' if $bold is true
index c51476c49310775827a8edc9a53bf32afc739350..1e7cb952af1d008a9b4d468c4c56573f6a31b055 100644 (file)
@@ -137,7 +137,7 @@ if (!$error && $_POST) {
                                                                                echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
                                                                                echo $time;
                                                                                $id = "export-$commands";
-                                                                               $export = ", <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('Export') . "</a><span id='$id' class='hidden'>: "
+                                                                               $export = ", <a href='#$id' onclick=\"return toggle('$id');\">" . lang('Export') . "</a><span id='$id' class='hidden'>: "
                                                                                        . html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " "
                                                                                        . html_select("format", $dump_format, $adminer_export["format"])
                                                                                        . "<input type='hidden' name='query' value='" . h($q) . "'>"
@@ -145,7 +145,7 @@ if (!$error && $_POST) {
                                                                                ;
                                                                                if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) {
                                                                                        $id = "explain-$commands";
-                                                                                       echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>$export";
+                                                                                       echo ", <a href='#$id' onclick=\"return toggle('$id');\">EXPLAIN</a>$export";
                                                                                        echo "<div id='$id' class='hidden'>\n";
                                                                                        select($explain, $connection2, $orgtables);
                                                                                        echo "</div>\n";
index 1b489262e1d7cdc9eb1d56ba2e89a5b2f44cd7f2..4aec4341b1e3620880957de2890be7b9a80c0f98 100644 (file)
@@ -73,12 +73,12 @@ function alterClass(el, className, enable) {
 
 /** Toggle visibility
 * @param string
-* @return boolean
+* @return boolean false
 */
 function toggle(id) {
        var el = qs('#' + id);
        el.className = (el.className == 'hidden' ? '' : 'hidden');
-       return true;
+       return false;
 }
 
 /** Set permanent cookie