aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_queue.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index a20ce10aa6..cbf0ff0089 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -470,7 +470,7 @@ class mcp_queue
function restore_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
+ global $phpEx, $phpbb_root_path, $request;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_restore')))
{
@@ -483,7 +483,7 @@ function restore_post($post_id_list, $id, $mode)
$post_info = get_post_data($post_id_list, 'm_restore');
- phpbb_content_visibility::unhide_posts_topics('restore', $post_info, $post_id_list);
+ $success_msg = phpbb_content_visibility::unhide_posts_topics('restore', $post_info, $post_id_list);
if (!$success_msg)
{
@@ -500,7 +500,20 @@ function restore_post($post_id_list, $id, $mode)
$add_message = '<br /><br />' . sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>');
}
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>') . $add_message);
+ $message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>') . $add_message;
+
+ if ($request->is_ajax())
+ {
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'REFRESH_DATA' => null,
+ 'visible' => true,
+ ));
+ }
+
+ trigger_error($message);
}
}
@@ -659,7 +672,7 @@ function approve_post($post_id_list, $id, $mode)
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $message,
'REFRESH_DATA' => null,
- 'approved' => true
+ 'visible' => true,
));
}
@@ -931,7 +944,7 @@ function disapprove_post($post_id_list, $id, $mode)
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $message,
'REFRESH_DATA' => null,
- 'approved' => false
+ 'visible' => false,
));
}