aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_queue.php
diff options
context:
space:
mode:
authorVjacheslav Trushkin <arty@phpbb.com>2012-03-31 10:43:06 +0300
committerVjacheslav Trushkin <arty@phpbb.com>2012-03-31 10:43:06 +0300
commit398a6c8045113f14900bdea8c70ba032f75b45f6 (patch)
tree1a9ff30f5eeca6faf0adbd314b60caf1869079c5 /phpBB/includes/mcp/mcp_queue.php
parent506951e8aff98582ebc56fcda9ed0626497ade77 (diff)
parent013a8649a5164b90310e76d99fae2186b831a5f0 (diff)
downloadforums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar
forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar.gz
forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar.bz2
forums-398a6c8045113f14900bdea8c70ba032f75b45f6.tar.xz
forums-398a6c8045113f14900bdea8c70ba032f75b45f6.zip
Merge branch 'develop' into feature/merging-style-components
* develop: (175 commits) [feature/ajax] Remove strange non-breaking spaces from approve button [feature/ajax] Add entirely unrelated but nice newlines [feature/ajax] Unify phpbb_json_response instantiation [feature/ajax] Fix acp_styles activate_deactivate ajax callback name [feature/ajax] Send correct activate/deactivate JSON response in acp_profile [ticket/10270] Alter background colors for posts [feature/ajax] Remove not working module enable/disable ajax code [feature/ajax] Replace static call to phpbb_request with OO [feature/ajax] Remove quick-reply AJAX handling until we have something good [ticket/10270] Changing close button for ajax popups [ticket/10270] Disabling links in disappearing content [ticket/10291] Fixed an AJAX bug on quick reply form submit. [ticket/10273] Fixed accepting / denying posts AJAX. [ticket/10272] Removed code that was prevent event propogation in AJAX. [ticket/10291] Fixed a bug in the quick reply AJAX. [feature/ajax] Handle acp_modules error cases with JSON response [feature/ajax] Fix filter check, quick mod tools data-attribute [feature/ajax] Use the error handler [feature/ajax] Generic error handling with a phpbb.alert box [feature/ajax] Change filter semantics, some minor adjustments ... Conflicts: phpBB/adm/style/acp_styles.html phpBB/includes/acp/acp_styles.php
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php31
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);
}
}