Skip to content

Commit

Permalink
Remove number of selected rows from confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Jul 12, 2013
1 parent e1ad0e4 commit af4269f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions adminer/db.inc.php
Expand Up @@ -115,8 +115,8 @@
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));
Expand Down
2 changes: 1 addition & 1 deletion adminer/edit.inc.php
Expand Up @@ -168,7 +168,7 @@
) . "' 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"])) {
Expand Down
2 changes: 1 addition & 1 deletion adminer/include/connect.inc.php
Expand Up @@ -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"
: ""
);
Expand Down
5 changes: 2 additions & 3 deletions adminer/include/functions.inc.php
Expand Up @@ -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>)
Expand Down
2 changes: 1 addition & 1 deletion adminer/select.inc.php
Expand Up @@ -504,7 +504,7 @@
<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
}
Expand Down

0 comments on commit af4269f

Please sign in to comment.