]> git.joonet.de Git - adminer.git/commitdiff
Remove number of selected rows from confirmation
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Jul 2013 00:02:14 +0000 (17:02 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Jul 2013 15:17:26 +0000 (08:17 -0700)
adminer/db.inc.php
adminer/edit.inc.php
adminer/include/connect.inc.php
adminer/include/functions.inc.php
adminer/select.inc.php

index bcc989994f689b70563ed1ddbf6e05961d6af881..7e095e1e0f2deada924e9b19d47a16c18ae5b36e 100644 (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));
index 91ff9844298899d60d8e881e850270de78c6cc58..0046f3e8186088c312bf88270eae950753a06b99 100644 (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"])) {
index 93eac11eac62602199755ce5782526705dc2ab31..907900ee11bd17a4838e68d7c7218d0789965d5e 100644 (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"
                                : ""
                        );
index 491117b446b626eb55525725f5eebbda8c999ac4..6077b056ba79aadfd07f506ae35947efb16d6ed4 100644 (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>)
index d00edede80e17f065b2b3dabd5d7c932d2d58798..84d3635f8d252d1f536883faf45cf7a7b77654e0 100644 (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
                        }