]> git.joonet.de Git - adminer.git/commitdiff
Display name of the object in confirmation when dropping it
authorJakub Vrana <jakub@vrana.cz>
Wed, 24 Jan 2018 17:13:05 +0000 (18:13 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 24 Jan 2018 17:13:05 +0000 (18:13 +0100)
13 files changed:
adminer/create.inc.php
adminer/database.inc.php
adminer/event.inc.php
adminer/foreign.inc.php
adminer/include/functions.inc.php
adminer/procedure.inc.php
adminer/scheme.inc.php
adminer/sequence.inc.php
adminer/trigger.inc.php
adminer/type.inc.php
adminer/user.inc.php
adminer/view.inc.php
changes.txt

index 8d26fcb9c443afbf6c5d7606dd56fea657db5f9a..9eebde4bff3920c5df1b433276dc0416c2855ddf 100644 (file)
@@ -198,7 +198,7 @@ edit_fields($row["fields"], $collations, "TABLE", $foreign_keys, $comments);
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <?php } ?>
 
-<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $TABLE"); ?><?php } ?>
 <?php
 if (support("partitioning")) {
        $partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
index 743e274adf1a3334e06363b1aaef18b0d1242487..7ff83142774ce8e08a52ef653a11b9008ce9a9ff 100644 (file)
@@ -70,7 +70,7 @@ echo script("focus(qs('#name'));");
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <?php
 if (DB != "") {
-       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n";
+       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop') . " " . DB) . "\n";
 } elseif (!$_POST["add_x"] && $_GET["db"] == "") {
        echo "<input type='image' class='icon' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
 }
index d008952b66fc646eb33576a40bf28df707b8da37..019a2cd57c8f9a514a87283ea08afa1da364c049 100644 (file)
@@ -47,6 +47,6 @@ if (!$row && $EVENT != "") {
 <p><?php textarea("EVENT_DEFINITION", $row["EVENT_DEFINITION"]); ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
-<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $EVENT"); ?><?php } ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 </form>
index 2e0ff74f780b5422931ab118854e2f48e6e124c1..216e4b0dca81aea1339a48383a2a05dc208caf22 100644 (file)
@@ -86,6 +86,6 @@ foreach ($row["source"] as $key => $val) {
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript>
 <?php } ?>
-<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $name"); ?><?php } ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 </form>
index 1276a1e0c5086ba8b8c5776386e839aa4fa10368..42ed855033e60061dd23bd357d21c3855d024af2 100644 (file)
@@ -221,10 +221,11 @@ function select_input($attrs, $options, $value = "", $onchange = "", $placeholde
 
 /** Get onclick confirmation
 * @param string
+* @param string
 * @return string
 */
-function confirm($selector = "qsl('input')") {
-       return script("$selector.onclick = function () { return confirm('" . lang('Are you sure?') . "'); };", "");
+function confirm($message = "", $selector = "qsl('input')") {
+       return script("$selector.onclick = function () { return confirm('" . ($message ? js_escape($message) . ". " : "") . lang('Are you sure?') . "'); };", "");
 }
 
 /** Print header for hidden fieldset (close by </div></fieldset>)
index 466e0b8d9a27815f726a8724f59e92395448f8dd..f16d93ac5bead7cb41171d1c2764c488476687ec 100644 (file)
@@ -49,6 +49,6 @@ if (isset($_GET["function"])) {
 <p><?php textarea("definition", $row["definition"]); ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
-<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $PROCEDURE"); ?><?php } ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 </form>
index 576a664283e5faf7493cbc1bc1fa43c677b6e941..4f64ecc41ec185575e30132f693a742453e9b7eb 100644 (file)
@@ -31,7 +31,7 @@ if (!$row) {
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <?php
 if ($_GET["ns"] != "") {
-       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n";
+       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop') . " $_GET[ns]") . "\n";
 }
 ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
index a7bac926679c323da734d7edb0a6b6812130433a..e51e4aee1b6e6b0e64332577739ed4148a133019 100644 (file)
@@ -28,7 +28,7 @@ if (!$row) {
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <?php
 if ($SEQUENCE != "") {
-       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n";
+       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop') . " $SEQUENCE") . "\n";
 }
 ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
index f7fa2e3c107c1976fd7a75416d16e4bbff1e9717..a99dca21078cef74832cd1b0165e5c44f0243e7c 100644 (file)
@@ -44,6 +44,6 @@ page_header(($name != "" ? lang('Alter trigger') . ": " . h($name) : lang('Creat
 <p><?php textarea("Statement", $row["Statement"]); ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
-<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $name"); ?><?php } ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 </form>
index 4ba78bc3a87ede73375b8eaf5ab76687caf5a121..310b5be30960ff891b89b455d8b6ba8823633d07 100644 (file)
@@ -22,7 +22,7 @@ if (!$row) {
 <p>
 <?php
 if ($TYPE != "") {
-       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n";
+       echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop') . " $TYPE") . "\n";
 } else {
        echo "<input name='name' value='" . h($row['name']) . "' autocapitalize='off'>\n";
        textarea("as", $row["as"]);
index 59a082e0c8b9f47fa203e006e278d6727ad502e4..af0fb72fa2f937a96848e30cd0e9ad4a1f2b249c 100644 (file)
@@ -184,6 +184,6 @@ echo "</table>\n";
 ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
-<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $USER@$_GET[host]"); ?><?php } ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 </form>
index fee3fcdf10691fd595efff13804335cf71b3324f..35acc5b92c10d0029ed140ccee7b5948a8453629 100644 (file)
@@ -53,6 +53,6 @@ page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, a
 <p><?php textarea("select", $row["select"]); ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
-<?php if ($_GET["view"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
+<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop') . " $TABLE"); ?><?php } ?>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 </form>
index 4de9e56e4bc9ce5ab8ede2357c3f96d2e8ad5427..c1243e98c37ad4d04f46fe10b1fc95e078f9d1d0 100644 (file)
@@ -1,4 +1,5 @@
 Adminer 4.5.0-dev:
+Display name of the object in confirmation when dropping it
 Display newlines in column comments (bug #573)
 Support current_timestamp() as default of time fields (bug #572)
 Hide window.opener from pages opened in a new window (bug #561)