diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 5418069d08..c3b06a77d7 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -85,7 +85,7 @@ $lang = array_merge($lang, array( 'DELETE_POSTS_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete these posts?', 'DELETE_REASON' => 'Delete reason', 'DELETE_REASON_EXPLAIN' => 'The reason is only used when the post is not deleted permanently.', - 'DELETE_POST_WARN' => 'Once deleted the post cannot be recovered', + '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', 'DELETE_TOPIC_PERMANENTLY_CONFIRM' => 'Are you sure you want to permanently delete this topic?', diff --git a/phpBB/posting.php b/phpBB/posting.php index 96907ee790..4c92d85a20 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -322,6 +322,12 @@ if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id)) // Handle delete mode... if ($mode == 'delete' || $mode == 'soft_delete') { + if ($mode == 'soft_delete' && $post_data['post_visibility'] == ITEM_DELETED) + { + $user->setup('posting'); + trigger_error('NO_POST'); + } + $soft_delete_reason = ($mode == 'soft_delete' && $auth->acl_get('m_softdelete', $forum_id)) ? utf8_normalize_nfc(request_var('delete_reason', '', true)) : ''; handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $soft_delete_reason); return; @@ -1110,6 +1116,14 @@ if ($submit || $preview || $refresh) $captcha->reset(); } + // Handle delete mode... + if ($request->is_set_post('delete') || $request->is_set_post('delete_permanent')) + { + $soft_delete_reason = (!$request->is_set_post('delete_permanent') && $auth->acl_get('m_softdelete', $forum_id)) ? utf8_normalize_nfc(request_var('delete_reason', '', true)) : ''; + handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $soft_delete_reason); + return; + } + // Check the permissions for post approval. Moderators are not affected. if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state'])) { @@ -1430,8 +1444,9 @@ $template->assign_vars(array( 'S_LOCK_TOPIC_CHECKED' => ($lock_topic_checked) ? ' checked="checked"' : '', 'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, 'S_LOCK_POST_CHECKED' => ($lock_post_checked) ? ' checked="checked"' : '', - 'S_SOFT_DELETE_CHECKED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? ' checked="checked"' : '', - 'S_SOFT_DELETE_ALLOWED' => ($mode == 'edit' && phpbb_content_visibility::can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false, + 'S_SOFTDELETE_CHECKED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? ' checked="checked"' : '', + 'S_DELETE_REASON' => ($mode == 'edit' && $auth->acl_get('m_softdelete', $forum_id)) ? true : false, + 'S_SOFTDELETE_ALLOWED' => ($mode == 'edit' && phpbb_content_visibility::can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false, 'S_RESTORE_ALLOWED' => $auth->acl_get('m_approve', $forum_id), 'S_IS_DELETED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? true : false, 'S_LINKS_ALLOWED' => $url_status, @@ -1584,10 +1599,11 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof } else { - global $template; + global $template, $request; $template->assign_vars(array( 'S_SOFTDELETED' => $post_data['post_visibility'] == ITEM_DELETED, + 'S_CHECKED_PERMANENT' => $request->is_set_post('delete_permanent') ? ' checked="checked"' : '', 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id) || $auth->acl_get('f_delete', $forum_id), 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id) || $auth->acl_get('f_softdelete', $forum_id), 'S_DELETE_REASON' => $auth->acl_get('m_softdelete', $forum_id), diff --git a/phpBB/styles/prosilver/template/confirm_delete_body.html b/phpBB/styles/prosilver/template/confirm_delete_body.html index 1e6e03ca0d..c56ee703a7 100644 --- a/phpBB/styles/prosilver/template/confirm_delete_body.html +++ b/phpBB/styles/prosilver/template/confirm_delete_body.html @@ -15,7 +15,7 @@
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index f8fccf2d2f..6a87126fb1 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -73,21 +73,6 @@
- - - - -
-
-
-
- - - -
-
-
-
@@ -261,6 +246,17 @@ + +
+
+
+
+ +
+ +
+ +