aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-03-11 23:08:40 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-03-11 23:08:40 +0100
commit4e9cf27394da2481a8ac81a2965873a3a16b136f (patch)
treee20544fc06e627772df9de777155a19cfa32f4ad
parentb727e1eedaab27c99a733b94bcdddbc55cc929d9 (diff)
downloadforums-4e9cf27394da2481a8ac81a2965873a3a16b136f.tar
forums-4e9cf27394da2481a8ac81a2965873a3a16b136f.tar.gz
forums-4e9cf27394da2481a8ac81a2965873a3a16b136f.tar.bz2
forums-4e9cf27394da2481a8ac81a2965873a3a16b136f.tar.xz
forums-4e9cf27394da2481a8ac81a2965873a3a16b136f.zip
[ticket/9657] Remove softdelete reason field when permanent delete is selected
PHPBB3-9657
-rw-r--r--phpBB/assets/javascript/core.js12
-rw-r--r--phpBB/language/en/posting.php4
-rw-r--r--phpBB/styles/prosilver/template/ajax.js8
-rw-r--r--phpBB/styles/prosilver/template/confirm_delete_body.html8
4 files changed, 26 insertions, 6 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 40da09377e..7a4aceee0b 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -317,6 +317,18 @@ phpbb.ajaxify = function(options) {
});
}
}, false);
+
+ // Add the click function to the code we just laoded.
+ // Should be removed and replace with a call to .on()
+ // when jQuery is updated to 1.7.x or higher
+ // $(document).on('click', '#delete_permanent', function () {});
+ $('#delete_permanent').click(function () {
+ if ($(this).attr('checked')) {
+ $('#delete_reason').hide();
+ } else {
+ $('#delete_reason').show();
+ }
+ });
}
}
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 1ed312f68c..c1d8c71783 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -83,8 +83,8 @@ $lang = array_merge($lang, array(
'DELETE_POST_PERMANENTLY' => 'Permanently delete this post so it can not be recovered',
'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?',
'DELETE_POSTS_PERMANENTLY_CONFIRM' => 'Are you sure you want to <strong>permanently</strong> delete these posts?',
- 'DELETE_REASON' => 'Delete reason',
- 'DELETE_REASON_EXPLAIN' => 'The reason is only used when the post is not deleted permanently.',
+ 'DELETE_REASON' => 'Soft delete reason',
+ 'DELETE_REASON_EXPLAIN' => 'The reason is only shown to moderators when post is soft deleted.',
'DELETE_POST_WARN' => 'Deleted this post',
'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?',
'DELETE_TOPIC_PERMANENTLY' => 'Permanently delete this topic so it can not be recovered',
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index 357e9a6fa3..5661a51bc9 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -230,6 +230,14 @@ $('#quick-mod-select').change(function () {
$('#quickmodform').submit();
});
+$('#delete_permanent').click(function () {
+ if ($(this).attr('checked')) {
+ $('#delete_reason').hide();
+ } else {
+ $('#delete_reason').show();
+ }
+});
+
/**
* Toggle the member search panel in memberlist.php.
*
diff --git a/phpBB/styles/prosilver/template/confirm_delete_body.html b/phpBB/styles/prosilver/template/confirm_delete_body.html
index 9f36d2d824..964c859634 100644
--- a/phpBB/styles/prosilver/template/confirm_delete_body.html
+++ b/phpBB/styles/prosilver/template/confirm_delete_body.html
@@ -11,9 +11,9 @@
<!-- ENDIF -->
<!-- IF S_DELETE_REASON -->
- <label>
+ <label id="delete_reason">
<strong>{L_DELETE_REASON}:</strong><br /><span>{L_DELETE_REASON_EXPLAIN}</span><br />
- <input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />
+ <input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />
</label>
<!-- ENDIF -->
<!-- ENDIF -->
@@ -50,9 +50,9 @@
<!-- ENDIF -->
<!-- IF S_DELETE_REASON -->
- <dl>
+ <dl id="delete_reason">
<dt><label for="delete_reason">{L_DELETE_REASON}:</label><br /><span>{L_DELETE_REASON_EXPLAIN}</span></dt>
- <dd><input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></dd>
+ <dd><input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></dd>
</dl>
<!-- ENDIF -->
</fieldset>