]> git.joonet.de Git - adminer.git/commitdiff
Display number of rows to export
authorJakub Vrana <jakub@vrana.cz>
Wed, 10 Jul 2013 17:12:58 +0000 (10:12 -0700)
committerJakub Vrana <jakub@vrana.cz>
Thu, 11 Jul 2013 18:20:03 +0000 (11:20 -0700)
adminer/db.inc.php
adminer/select.inc.php
adminer/static/functions.js

index 4ba8ef8045517dfb5a6037af964f2314f5d1bd20..8ecec80227bb17c13aba03e32d7969258f98feda 100644 (file)
@@ -122,7 +122,7 @@ if ($adminer->homepage()) {
                                        echo (support("copy") ? " <input type='submit' name='copy' value='" . lang('Copy') . "'>" : "");
                                        echo "\n";
                                }
-                               echo "<input type='hidden' name='all' value='' onclick='selectCount(formChecked(this, /^(tables|views)\[/));'>\n"; // used by trCheck()
+                               echo "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^(tables|views)\[/));\">\n"; // used by trCheck()
                                echo "<input type='hidden' name='token' value='$token'>\n";
                                echo "</div></fieldset>\n";
                        }
index adcef7397fce50b8f26a56678a47da661167118e..2f467b7a38269a81a650ef82cc9f426909faa653 100644 (file)
@@ -493,7 +493,7 @@ if (!$columns && support("table")) {
                        
                        echo "<p>\n";
                        echo ($found_rows !== false ? "(" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " : "");
-                       echo checkbox("all", 1, 0, lang('whole result'), "selectCount(this.checked ? '$found_rows' : formChecked(this, /check/));") . "\n";
+                       echo checkbox("all", 1, 0, lang('whole result'), "var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$found_rows' : checked); selectCount('selected2', this.checked || !checked ? '$found_rows' : checked);") . "\n";
                        
                        if ($adminer->selectCommandPrint()) {
                                ?>
@@ -507,7 +507,6 @@ if (!$columns && support("table")) {
 </div></fieldset>
 <?php
                        }
-                       echo (!$group && $select ? "" : "<script type='text/javascript'>tableCheck();</script>\n");
                        
                        $format = $adminer->dumpFormat();
                        foreach ((array) $_GET["columns"] as $column) {
@@ -517,13 +516,15 @@ if (!$columns && support("table")) {
                                }
                        }
                        if ($format) {
-                               print_fieldset("export", lang('Export'));
+                               print_fieldset("export", lang('Export') . " <span id='selected2'></span>");
                                $output = $adminer->dumpOutput();
                                echo ($output ? html_select("output", $output, $adminer_import["output"]) . " " : "");
                                echo html_select("format", $format, $adminer_import["format"]);
                                echo " <input type='submit' name='export' value='" . lang('Export') . "'>\n";
                                echo "</div></fieldset>\n";
                        }
+                       
+                       echo (!$group && $select ? "" : "<script type='text/javascript'>tableCheck();</script>\n");
                }
                
                if ($adminer->selectImportPrint()) {
index 138305bf3298f67951db9cad41012efaf6b54f68..77a122a64858839dd6d7508a857cc12707bcb8ea 100644 (file)
@@ -67,9 +67,10 @@ function trCheck(el) {
 
 /** Fill number of selected items
 * @param string
+* @param string
 */
-function selectCount(count) {
-       setHtml('selected', (count === '' ? '' : '(' + count + ')'));
+function selectCount(id, count) {
+       setHtml(id, (count === '' ? '' : '(' + count + ')'));
 }
 
 /** Check all elements matching given name