diff options
author | David King <imkingdavid@gmail.com> | 2012-03-30 20:16:00 -0400 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2012-03-30 20:16:00 -0400 |
commit | 013a8649a5164b90310e76d99fae2186b831a5f0 (patch) | |
tree | 3ad85edcdf4720c524214c68a7a4c80150ebb2f2 /phpBB/includes/mcp/mcp_queue.php | |
parent | 4f97cc12951b2be6fa8d7962beaf631f7c82fb43 (diff) | |
parent | b42e10df28742ba5a68d15e740e33aa7f8260f40 (diff) | |
download | forums-013a8649a5164b90310e76d99fae2186b831a5f0.tar forums-013a8649a5164b90310e76d99fae2186b831a5f0.tar.gz forums-013a8649a5164b90310e76d99fae2186b831a5f0.tar.bz2 forums-013a8649a5164b90310e76d99fae2186b831a5f0.tar.xz forums-013a8649a5164b90310e76d99fae2186b831a5f0.zip |
Merge remote-tracking branch 'igorw/feature/ajax' into develop
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index ef32b5f03c..59fa8b7263 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -451,6 +451,7 @@ function approve_post($post_id_list, $id, $mode) { global $db, $template, $user, $config; global $phpEx, $phpbb_root_path; + global $request; if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) { @@ -709,7 +710,20 @@ function approve_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, + 'approved' => true + )); + } + + trigger_error($message); } } @@ -968,7 +982,20 @@ function disapprove_post($post_id_list, $id, $mode) } else { + $message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'); + + 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, + 'approved' => false + )); + } + meta_refresh(3, $redirect); - trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); + trigger_error($message); } } |