diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-12-20 15:23:29 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-12-20 15:23:29 +0100 |
commit | 24e1881ea1fd4da0bdf6de8f58cf8527b9087270 (patch) | |
tree | d69ccd88006c06e46599aee9705a110397ed8f95 /phpBB/includes | |
parent | 6028068841a7ae54d0bdb9f61e554b0a2a029157 (diff) | |
download | forums-24e1881ea1fd4da0bdf6de8f58cf8527b9087270.tar forums-24e1881ea1fd4da0bdf6de8f58cf8527b9087270.tar.gz forums-24e1881ea1fd4da0bdf6de8f58cf8527b9087270.tar.bz2 forums-24e1881ea1fd4da0bdf6de8f58cf8527b9087270.tar.xz forums-24e1881ea1fd4da0bdf6de8f58cf8527b9087270.zip |
[feature/soft-delete] Split up on the initial switch instead of a second one
Also fixing some documentation issues
PHPBB3-9657
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 8b7b4ffda8..dd3321e4e5 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -45,55 +45,44 @@ class mcp_queue switch ($action) { case 'approve': - case 'disapprove': case 'restore': include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $post_id_list = $request->variable('post_id_list', array(0)); $topic_id_list = $request->variable('topic_id_list', array(0)); - if ($action != 'disapprove') + if (!empty($post_id_list)) { - if (!empty($post_id_list)) - { - self::approve_posts($action, $post_id_list, 'queue', $mode); - } - else if (!empty($topic_id_list)) - { - self::approve_topics($action, $topic_id_list, 'queue', $mode); - } - else - { - trigger_error('NO_POST_SELECTED'); - } + self::approve_posts($action, $post_id_list, 'queue', $mode); + } + else if (!empty($topic_id_list)) + { + self::approve_topics($action, $topic_id_list, 'queue', $mode); } else { - if (!empty($topic_id_list)) - { - $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : ITEM_UNAPPROVED; - $sql = 'SELECT post_id - FROM ' . POSTS_TABLE . ' - WHERE post_visibility = ' . $post_visibility . ' - AND ' . $db->sql_in_set('topic_id', $topic_id_list); - $result = $db->sql_query($sql); + trigger_error('NO_POST_SELECTED'); + } + break; - $post_id_list = array(); - while ($row = $db->sql_fetchrow($result)) - { - $post_id_list[] = (int) $row['post_id']; - } - $db->sql_freeresult($result); - } + case 'delete': + case 'disapprove': + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - if (!empty($post_id_list)) - { - self::disapprove_posts($post_id_list, 'queue', $mode); - } - else - { - trigger_error('NO_POST_SELECTED'); - } + $post_id_list = $request->variable('post_id_list', array(0)); + $topic_id_list = $request->variable('topic_id_list', array(0)); + + if (!empty($post_id_list)) + { + self::disapprove_posts($post_id_list, 'queue', $mode); + } + else if (!empty($topic_id_list)) + { + self::disapprove_topics($action, $topic_id_list, 'queue', $mode); + } + else + { + trigger_error('NO_POST_SELECTED'); } break; } @@ -523,7 +512,7 @@ class mcp_queue * @param $post_id_list array IDs of the posts to approve/restore * @param $id mixed Category of the current active module * @param $mode string Active module - * @return void + * @return null */ static public function approve_posts($action, $post_id_list, $id, $mode) { @@ -716,7 +705,7 @@ class mcp_queue * @param $topic_id_list array IDs of the topics to approve/restore * @param $id mixed Category of the current active module * @param $mode string Active module - * @return void + * @return null */ static public function approve_topics($action, $topic_id_list, $id, $mode) { @@ -876,10 +865,10 @@ class mcp_queue /** * Disapprove Post * - * @param $post_id_list array IDs of the posts to approve/restore + * @param $post_id_list array IDs of the posts to disapprove/delete * @param $id mixed Category of the current active module * @param $mode string Active module - * @return void + * @return null */ static public function disapprove_posts($post_id_list, $id, $mode) { |