1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[feature/soft-delete] Fix restoring/approving posts with mcp moderation

PHPBB3-9567
This commit is contained in:
Joas Schilling
2012-10-31 14:09:23 +01:00
parent f0e2d21f8c
commit 18dec1026a
3 changed files with 21 additions and 14 deletions

View File

@@ -84,8 +84,8 @@ function mcp_topic_view($id, $mode, $action)
$subject = $topic_info['topic_title'];
}
// Approve posts?
if ($action == 'approve' && $auth->acl_get('m_approve', $topic_info['forum_id']))
// Restore or pprove posts?
if (($action == 'restore' || $action == 'approve') && $auth->acl_get('m_approve', $topic_info['forum_id']))
{
include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -98,7 +98,7 @@ function mcp_topic_view($id, $mode, $action)
if (!$sort)
{
approve_post($post_id_list, $id, $mode);
mcp_queue::approve_posts($action, $post_id_list, $id, $mode);
}
}
@@ -175,7 +175,7 @@ function mcp_topic_view($id, $mode, $action)
$topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id);
}
$has_unapproved_posts = false;
$has_unapproved_posts = $has_deleted_posts = false;
// Grab extensions
$extensions = $attachments = array();
@@ -225,6 +225,11 @@ function mcp_topic_view($id, $mode, $action)
$has_unapproved_posts = true;
}
if ($row['post_visibility'] == ITEM_DELETED)
{
$has_deleted_posts = true;
}
$post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('postrow', array(
@@ -305,7 +310,7 @@ function mcp_topic_view($id, $mode, $action)
{
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $posts_per_page, $start);
}
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&t=' . $topic_info['topic_id']),
@@ -319,7 +324,7 @@ function mcp_topic_view($id, $mode, $action)
'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
'DELETED_IMG' => $user->img('icon_topic_deleted', 'POST_DELETED'),
'DELETED_IMG' => $user->img('icon_topic_deleted', 'POST_DELETED'),
'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'),
'S_MCP_ACTION' => "$url&i=$id&mode=$mode&action=$action&start=$start",
@@ -328,6 +333,7 @@ function mcp_topic_view($id, $mode, $action)
'S_CAN_MERGE' => ($auth->acl_get('m_merge', $topic_info['forum_id'])) ? true : false,
'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false,
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_RESTORE' => ($has_deleted_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false,
'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']),