1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 16:17:48 +02:00

Display number of rows to export

This commit is contained in:
Jakub Vrana
2013-07-10 10:12:58 -07:00
parent 9ab32bdb3c
commit 491cdefc84
3 changed files with 8 additions and 6 deletions

View 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";
}

View 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()) {

View 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