]> git.joonet.de Git - adminer.git/commitdiff
Get number of rows on export page asynchronously
authorJakub Vrana <jakub@vrana.cz>
Sat, 18 May 2013 00:40:08 +0000 (17:40 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sat, 18 May 2013 00:40:08 +0000 (17:40 -0700)
adminer/dump.inc.php
changes.txt

index 02b13dd429426f4f86bbbfa983f30221a9c309c3..586996580fae82b8efaa69090c21d539cffec8e9 100644 (file)
@@ -169,20 +169,24 @@ if (DB != "") {
        echo "</thead>\n";
        
        $views = "";
-       //! defer number of rows to JavaScript
-       foreach (table_status() as $name => $table_status) {
+       $tables_list = tables_list();
+       foreach ($tables_list as $name => $type) {
                $prefix = ereg_replace("_.*", "", $name);
                $checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
                $print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick(event, this); formUncheck('check-tables');");
-               if (is_view($table_status)) {
+               if ($type !== null && !eregi("table", $type)) {
                        $views .= "$print\n";
                } else {
-                       echo "$print<td align='right'><label>" . ($table_status["Engine"] == "InnoDB" && $table_status["Rows"] ? "~ " : "") . $table_status["Rows"] . checkbox("data[]", $name, $checked, "", "checkboxClick(event, this); formUncheck('check-data');") . "</label>\n";
+                       echo "$print<td align='right'><label><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "checkboxClick(event, this); formUncheck('check-data');") . "</label>\n";
                }
                $prefixes[$prefix]++;
        }
        echo $views;
        
+       if ($tables_list) {
+               echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n";
+       }
+       
 } else {
        echo "<thead><tr><th style='text-align: left;'><label><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . " onclick='formCheck(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n";
        $databases = $adminer->databases();
index 06c7fba8611794047cee2f4ca808b718ddc89a51..e79cae0779dc53ce8dd4861cff71e9b2f4d7bab1 100644 (file)
@@ -13,6 +13,7 @@ Fix resetting search (bug #3612507)
 Don't use LIMIT 1 if updating unique row (bug #3613109)
 Restrict editing rows without unique identifier to search results
 Display navigation bellow main content on mobile browsers
+Get number of rows on export page asynchronously
 MySQL: Optimize create table page and Editor navigation
 MySQL: Display bit type as binary number
 MySQL: Improve export of binary data types