Remove number of selected rows from confirmation

This commit is contained in:
Jakub Vrana 2013-07-11 17:02:14 -07:00
parent e1ad0e4f39
commit af4269f26d
5 changed files with 7 additions and 8 deletions

View file

@ -115,8 +115,8 @@ if ($adminer->homepage()) {
echo "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>"
. (ereg('^(sql|sqlite|pgsql)$', $jush) ? ($jush != "sqlite" ? "<input type='submit' value='" . lang('Analyze') . "'> " : "") . "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " : "")
. ($jush == "sql" ? "<input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "")
. (support("table") ? "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm("formChecked(this, /tables/)") . "> " : "")
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /tables|views/)") . ">\n";
. (support("table") ? "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm() . "> " : "")
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
$databases = (support("scheme") ? schemas() : $adminer->databases());
if (count($databases) != 1 && $jush != "sqlite") {
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));

View file

@ -168,7 +168,7 @@ if ($fields) {
) . "' title='Ctrl+Shift+Enter'>\n";
}
}
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\">\n"
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n"
: ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n")
);
if (isset($_GET["select"])) {

View file

@ -47,7 +47,7 @@ function connect_error() {
echo (support("database")
? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n"
. "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n" // used by trCheck()
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)") . ">\n"
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n"
. "</div></fieldset>\n"
: ""
);

View file

@ -164,11 +164,10 @@ function select_input($attrs, $options, $value = "", $placeholder = "") {
}
/** Get onclick confirmation
* @param string JavaScript expression
* @return string
*/
function confirm($count = "") {
return " onclick=\"return confirm('" . lang('Are you sure?') . ($count ? " (' + $count + ')" : "") . "');\"";
function confirm() {
return " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
}
/** Print header for hidden fieldset (close by </div></fieldset>)

View file

@ -504,7 +504,7 @@ if (!$columns && support("table")) {
<fieldset><legend><?php echo lang('Selected'); ?> <span id="selected"></span></legend><div>
<input type="submit" name="edit" value="<?php echo lang('Edit'); ?>">
<input type="submit" name="clone" value="<?php echo lang('Clone'); ?>">
<input type="submit" name="delete" value="<?php echo lang('Delete'); ?>" onclick="return confirm('<?php echo lang('Are you sure?'); ?> (' + (this.form['all'].checked ? '<?php echo $display_rows; ?>' : formChecked(this, /check/)) + ')');">
<input type="submit" name="delete" value="<?php echo lang('Delete'); ?>"<?php echo confirm(); ?>>
</div></fieldset>
<?php
}