From 06ce6828b166267917d5a5774a1ec554254786aa Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Wed, 23 Sep 2009 12:21:14 +0000 Subject: [PATCH] Display number of manipulated rows in JS confirm git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1133 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/db.inc.php | 14 ++++++-------- adminer/select.inc.php | 2 +- adminer/static/functions.js | 11 +++++++++++ changes.txt | 1 + editor/include/adminer.inc.php | 3 +-- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/adminer/db.inc.php b/adminer/db.inc.php index 6e45de49..58156cde 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -8,15 +8,13 @@ if ($tables_views && !$error) { queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once } if (isset($_POST["truncate"])) { - if ($_POST["tables"]) { - foreach ($_POST["tables"] as $table) { - if (!queries("TRUNCATE " . idf_escape($table))) { - $result = false; - break; - } + foreach ((array) $_POST["tables"] as $table) { + if (!queries("TRUNCATE " . idf_escape($table))) { + $result = false; + break; } - $message = lang('Tables have been truncated.'); } + $message = lang('Tables have been truncated.'); } elseif (isset($_POST["move"])) { $rename = array(); foreach ($tables_views as $table) { @@ -66,7 +64,7 @@ if (!$table_status) { } } echo "\n"; - echo "

\n"; + echo "

\n"; $dbs = get_databases(); if (count($dbs) != 1) { $db = (isset($_POST["target"]) ? $_POST["target"] : DB); diff --git a/adminer/select.inc.php b/adminer/select.inc.php index e9426537..a698e16d 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -280,7 +280,7 @@ if (!$columns) { } echo " (" . lang('%d row(s)', $found_rows) . ') \n"; - echo (information_schema(DB) ? "" : "

" . lang('Edit') . "
\n"); + echo (information_schema(DB) ? "" : "
" . lang('Edit') . "
\n"); print_fieldset("export", lang('Export')); echo "$dump_output $dump_format $dump_compress \n"; echo "\n"; diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 5b882b96..4a3b3fe3 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -26,6 +26,17 @@ function form_uncheck(id) { document.getElementById(id).checked = false; } +function form_checked(el, name) { + var checked = 0; + var elems = el.form.elements; + for (var i=0; i < elems.length; i++) { + if (name.test(elems[i].name) && elems[i].checked) { + checked++; + } + } + return checked; +} + function table_click(event) { var el = event.target || event.srcElement; while (!/^tr$/i.test(el.tagName)) { diff --git a/changes.txt b/changes.txt index cad43e08..ee1dbca8 100644 --- a/changes.txt +++ b/changes.txt @@ -2,6 +2,7 @@ Adminer 2.1.1-dev: Display table links above table structure Fix removed default in ALTER Display whitespace in texts (bug #2858042) +Display number of manipulated rows in JS confirm E-mail attachments (Editor) Move

to $adminer->navigation (customization) Rename get_dbh to connection (customization) diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 60fb4ad6..aebe2920 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -185,7 +185,6 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5 } function selectEmailPrint($emailFields, $columns) { - global $confirm; if ($emailFields) { echo '
' . lang('E-mail') . "
\n"; } }