aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-11-04 01:17:22 +0100
committerJoas Schilling <nickvergessen@gmx.de>2012-11-04 01:17:22 +0100
commit885e19e58a54dc5f06161dd56d7e1a2df34df95d (patch)
treeda30ce1745ad717485b390bb34732d1dd12c99d2 /phpBB
parent269330749f1e456caf5c2e787448820449586ed4 (diff)
downloadforums-885e19e58a54dc5f06161dd56d7e1a2df34df95d.tar
forums-885e19e58a54dc5f06161dd56d7e1a2df34df95d.tar.gz
forums-885e19e58a54dc5f06161dd56d7e1a2df34df95d.tar.bz2
forums-885e19e58a54dc5f06161dd56d7e1a2df34df95d.tar.xz
forums-885e19e58a54dc5f06161dd56d7e1a2df34df95d.zip
[feature/soft-delete] Provide the options for permanent delete via AJAX
AJAX confirm_box should be able to call the template file given. The confirm message is HTML so far, but generating the HTML in the php code is not, what we want. PHPBB3-9567
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/posting.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 4c92d85a20..16dfad3b91 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1604,8 +1604,8 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof
$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_ALLOWED_DELETE' => $auth->acl_gets('m_delete', 'f_delete', $forum_id),
+ 'S_ALLOWED_SOFTDELETE' => $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id),
'S_DELETE_REASON' => $auth->acl_get('m_softdelete', $forum_id),
));
@@ -1620,7 +1620,24 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof
$s_hidden_fields['delete_permanent'] = '1';
}
- confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html');
+ // @todo: This needs fixing! AJAX confirm_box should be able to call template files!
+ if ($request->is_ajax())
+ {
+ $l_confirm = (!isset($user->lang[$l_confirm . '_CONFIRM'])) ? $l_confirm : $user->lang[$l_confirm . '_CONFIRM'];
+ if ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id))
+ {
+ $l_confirm .= '<br />' . $user->lang['DELETE_PERMANENTLY'] . ': <input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" />';
+ }
+ if ($auth->acl_get('m_softdelete', $forum_id))
+ {
+ $l_confirm .= '<br />' . $user->lang['DELETE_REASON'] . ': <input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />';
+ }
+ confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields));
+ }
+ else
+ {
+ confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html');
+ }
}
}