]> git.joonet.de Git - adminer.git/commitdiff
Print SQL query by messages
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 3 Sep 2008 09:35:12 +0000 (09:35 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 3 Sep 2008 09:35:12 +0000 (09:35 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@480 7c3ca157-0c34-0410-bff1-cbf682f78f5c

default.css
design.inc.php
functions.inc.php
select.inc.php

index 53e4f07e2a7b495a5e5f0223d6a52548dcaef093..01c8e6df56b89844423b46d992d4fb14d6e668fd 100644 (file)
@@ -12,6 +12,8 @@ th { background: #eee; }
 fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: 0 .5em .5em 0; border: 1px solid #999; }
 p { margin: 0 20px 1em 0; }
 img { vertical-align: middle; }
+code { background-color: #eee; }
+.js .hidden { display: none; }
 .error { color: red; background: #fee; padding: .5em .8em; }
 .message { color: green; background: #efe; padding: .5em .8em; }
 .char { color: #007F00; }
index a0705412374a6f3c5256671ba647d72e4028d869..d8a97a960a6aacd8c2712398d8b287f555911207 100644 (file)
@@ -15,6 +15,14 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 </head>
 
 <body>
+<script type="text/javascript">
+document.body.className = 'js';
+function toggle(id) {
+       var el = document.getElementById(id);
+       el.className = (el.className == 'hidden' ? '' : 'hidden');
+       return true;
+}
+</script>
 
 <div id="content">
 <?php
index 2a24d66f5d0646be8a4ebbf84c1a73178f846dbf..33cd8726b475e32184da289fdc9990ff9144bbc5 100644 (file)
@@ -197,7 +197,8 @@ function redirect($location, $message = null) {
 
 function query_redirect($query, $location, $message, $redirect = true, $execute = true) {
        global $mysql, $error, $SELF;
-       $sql = ' <a href="' . htmlspecialchars($SELF) . 'sql=' . urlencode($query) . '">' . lang('SQL command') . "</a>";
+       $id = "sql-" . count($_SESSION["messages"]);
+       $sql = " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code> <a href="' . htmlspecialchars($SELF) . 'sql=' . urlencode($query) . '">' . lang('Edit') . '</a></span>';
        if ($execute && !$mysql->query($query)) {
                $error = htmlspecialchars($mysql->error) . $sql;
                return false;
index cc353d6b7a983fcbaf7ddd78e1846fb2a38cc0a3..ef39cc2d3e01c6ec42d23a3e8ec234a40fc3d6c1 100644 (file)
@@ -214,7 +214,7 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
        echo "</form>\n";
        
        $query = "SELECT " . ($select ? (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) : "*") . " $from";
-       echo "<p><code class='jush-sql'>" . htmlspecialchars($query) . "</code> - <a href='" . htmlspecialchars($SELF) . "sql=" . urlencode($query) . "'>" . lang('edit') . "</a></p>\n";
+       echo "<p><code class='jush-sql'>" . htmlspecialchars($query) . "</code> <a href='" . htmlspecialchars($SELF) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a></p>\n";
        
        $result = $mysql->query($query);
        if (!$result) {