diff --git a/changes.txt b/changes.txt index 6e10d813..3de79ae2 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ phpMinAdmin 1.11.0: Connection through socket by server :/path/to/socket +Simplify export Display execution time in SQL query Relative date and time functions Version checker diff --git a/dump.inc.php b/dump.inc.php index 2d56bb5a..783ea7ba 100644 --- a/dump.inc.php +++ b/dump.inc.php @@ -9,18 +9,6 @@ function tar_file($filename, $contents) { return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512); } -function dump_link($type, $name, $val, $attrs = "") { - global $SELF; - $check = $_GET; - $check[$type] = $val; - return '" . ($val ? $val : lang('skip')) . "" - ; -} - if ($_POST) { $ext = dump_headers((strlen($_GET["dump"]) ? $_GET["dump"] : $_GET["db"]), (!strlen($_GET["db"]) || count(array_filter((array) $_POST["tables"]) + array_filter((array) $_POST["data"])) > 1)); if ($_POST["format"] != "csv") { @@ -143,51 +131,47 @@ page_header(lang('Export'), "", (strlen($_GET["export"]) ? array("table" => $_GE ?>
-

+ +\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; // INSERT INTO ... ON DUPLICATE KEY UPDATE +?> +
" . lang('Output') . "$dump_output
" . lang('Format') . "$dump_format
" . lang('Database') . "
" . lang('Tables') . "
" . lang('Data') . "
+

\n" . lang('Database') . ""; -foreach (array('', 'USE', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) { - echo '' . dump_link("db_check", "databases", $val) . ''; -} -echo "\n"; -foreach ((strlen($_GET["db"]) ? array($_GET["db"]) : get_databases()) as $db) { - if ($db != "information_schema" || $dbh->server_info < 5) { - echo "" . htmlspecialchars($db) . ""; - foreach (array('', 'USE', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) { - echo '"; +if (!strlen($_GET["db"])) { + echo "\n\n"; + foreach (get_databases() as $db) { + if ($db != "information_schema" || $dbh->server_info < 5) { + echo '\n"; //! uncheck all } - echo "\n"; } + echo "
" . lang('Database') . "
\n"; } -echo "\n"; -echo "\n"; -foreach (array('', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) { - echo ''; -} -foreach (array('', 'TRUNCATE, INSERT', 'INSERT', 'UPDATE') as $val) { - echo ''; -} -echo "\n"; -$views = ""; -$result = $dbh->query(strlen($_GET["db"]) ? "SHOW TABLE STATUS" : "SELECT 'Engine'"); -odd(''); -while ($row = $result->fetch_assoc()) { - $print = ""; - foreach (array('', 'DROP, CREATE', 'CREATE', 'CREATE, ALTER') as $val) { - $print .= '"; - } - if (!$row["Engine"]) { - $views .= "$print\n"; - } else { - foreach (array('', 'TRUNCATE, INSERT', 'INSERT', 'UPDATE') as $val) { - $print .= '"; +if (strlen($_GET["db"])) { + $checked = (strlen($_GET["dump"]) ? "" : " checked='checked'"); + echo "
" . lang('Tables') . "" . lang('Structure') . "" . lang('Data') . "
' . dump_link("table_check", "tables", $val) . '' . dump_link("data_check", "data", $val, ($val == 'UPDATE' ? " title='INSERT INTO ... ON DUPLICATE KEY UPDATE'" : "")) . '
" . htmlspecialchars($row["Name"]) . "
\n"; + echo ""; + echo ""; + echo "\n"; + $views = ""; + $result = $dbh->query("SHOW TABLE STATUS"); + while ($row = $result->fetch_assoc()) { + $checked = (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : " checked='checked'"); + $print = '"; //! uncheck all + if (!$row["Engine"]) { + $views .= "$print\n"; + } else { + echo $print . '\n"; } - echo "$print\n"; } + echo "$views
\n"; } -echo "$views\n"; ?>

diff --git a/functions.js b/functions.js index 092674c3..4c8d4510 100644 --- a/functions.js +++ b/functions.js @@ -256,12 +256,16 @@ function schema_mouseup(ev) { -function dump_check(a, name, value) { - var inputs = a.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('input'); +function dump_check(el, name) { + var inputs = el.form.getElementsByTagName('input'); for (var i=0; i < inputs.length; i++) { if (name.test(inputs[i].name)) { - inputs[i].checked = (inputs[i].value == value); + inputs[i].checked = el.checked; } } return true; } + +function dump_uncheck(id) { + document.getElementById(id).checked = false; +}