aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJosh Woody <a_jelly_doughnut@phpbb.com>2010-07-05 21:58:20 -0500
committerJoas Schilling <nickvergessen@gmx.de>2012-08-29 17:50:12 +0200
commitf570558a8da65596b0ca2700e2e7829548d2393a (patch)
tree25a363747a68630d505b0f337b4ef58300d35763 /phpBB/includes
parenta80cfafdd91a384ba810a8ee0d43406bba955faa (diff)
downloadforums-f570558a8da65596b0ca2700e2e7829548d2393a.tar
forums-f570558a8da65596b0ca2700e2e7829548d2393a.tar.gz
forums-f570558a8da65596b0ca2700e2e7829548d2393a.tar.bz2
forums-f570558a8da65596b0ca2700e2e7829548d2393a.tar.xz
forums-f570558a8da65596b0ca2700e2e7829548d2393a.zip
[feature/soft-delete] Add a processor for action == restore in mcp_queue.php
Restoring a post within mcp_queue.php didn't do anything before this commit. Now it does, by way of a function which is very similar to approve_post. PHPBB3-9657
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php45
1 files changed, 43 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 221dfffebc..597be855b7 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -62,7 +62,7 @@ class mcp_queue
}
else if ($action == 'restore')
{
-// do something
+ restore_post($post_id_list, 'queue', $mode);
}
else
{
@@ -462,6 +462,47 @@ class mcp_queue
}
}
+
+/**
+* Approve Post/Topic
+*/
+function restore_post($post_id_list, $id, $mode)
+{
+ global $db, $template, $user, $config;
+ global $phpEx, $phpbb_root_path;
+
+ if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_restore')))
+ {
+ trigger_error('NOT_AUTHORISED');
+ }
+
+ $redirect = request_var('redirect', build_url(array('quickmod')));
+ $redirect = reapply_sid($redirect);
+ $success_msg = '';
+
+ $post_info = get_post_data($post_id_list, 'm_restore');
+
+ phpbb_content_visibility::unhide_posts_topics('restore', $post_info, $post_id_list);
+
+ if (!$success_msg)
+ {
+ redirect($redirect);
+ }
+ else
+ {
+ meta_refresh(3, $redirect);
+
+ // If approving one post, also give links back to post...
+ $add_message = '';
+ if (sizeof($post_id_list) == 1 && !empty($post_url))
+ {
+ $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);
+ }
+}
+
/**
* Approve Post/Topic
*/
@@ -493,7 +534,7 @@ function approve_post($post_id_list, $id, $mode)
{
$notify_poster = (isset($_REQUEST['notify_poster'])) ? true : false;
- phpbb_content_visibility::unhide_posts_topics('approve', $post_info, $post_id_list);
+ phpbb_content_visibility::unhide_posts_topics('approve', $post_info, $post_id_list);
$messenger = new messenger();