diff options
author | Callum Macrae <callum@lynxphp.com> | 2012-03-04 10:32:06 +0000 |
---|---|---|
committer | Callum Macrae <callum@lynxphp.com> | 2012-03-17 18:06:37 +0000 |
commit | 9a07f5287c91549dc989615f0cf6dc1fd8f82e5f (patch) | |
tree | a7053f3fd32481d280e26a0aeaa459320b384a5c /phpBB/viewtopic.php | |
parent | 2b0282cba73c8649b1649444a23c3913cc652de2 (diff) | |
download | forums-9a07f5287c91549dc989615f0cf6dc1fd8f82e5f.tar forums-9a07f5287c91549dc989615f0cf6dc1fd8f82e5f.tar.gz forums-9a07f5287c91549dc989615f0cf6dc1fd8f82e5f.tar.bz2 forums-9a07f5287c91549dc989615f0cf6dc1fd8f82e5f.tar.xz forums-9a07f5287c91549dc989615f0cf6dc1fd8f82e5f.zip |
[ticket/10510] Moved quick-mod tools into a loop.
PHPBB3-10510
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r-- | phpBB/viewtopic.php | 106 |
1 files changed, 93 insertions, 13 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 450ebfeda8..12a611ce6f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -517,6 +517,99 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']); // Quick mod tools $allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false; +if ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED)) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => (($topic_data['topic_status'] == ITEM_UNLOCKED) ? 'lock' : 'unlock'), + 'TITLE' => $user->lang[(($topic_data['topic_status'] == ITEM_UNLOCKED) ? 'LOCK' : 'UNLOCK') . '_TOPIC'] + )); +} + +if ($auth->acl_get('m_delete', $forum_id)) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'delete_topic', + 'TITLE' => $user->lang['DELETE_TOPIC'] + )); +} + +if ($auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'move', + 'TITLE' => $user->lang['MOVE_TOPIC'] + )); +} + +if ($auth->acl_get('m_split', $forum_id)) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'split', + 'TITLE' => $user->lang['SPLIT_TOPIC'] + )); +} + +if ($auth->acl_get('m_merge', $forum_id)) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'merge', + 'TITLE' => $user->lang['MERGE_POSTS'] + )); + + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'merge_topic', + 'TITLE' => $user->lang['MERGE_TOPIC'] + )); +} + +if ($auth->acl_get('m_move', $forum_id)) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'fork', + 'TITLE' => $user->lang['FORK_TOPIC'] + )); +} + +if ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'make_normal', + 'TITLE' => $user->lang['MAKE_NORMAL'] + )); +} + +if ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'make_sticky', + 'TITLE' => $user->lang['MAKE_STICKY'] + )); +} + +if ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'make_announce', + 'TITLE' => $user->lang['MAKE_ANNOUNCE'] + )); +} + +if ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'make_global', + 'TITLE' => $user->lang['MAKE_GLOBAL'] + )); +} + +if ($auth->acl_get('m_', $forum_id)) +{ + $template->assign_block_vars('quickmod', array( + 'VALUE' => 'topic_logs', + 'TITLE' => $user->lang['VIEW_TOPIC_LOGS'] + )); +} + // If we've got a hightlight set pass it on to pagination. $pagination = generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start); @@ -603,19 +696,6 @@ $template->assign_vars(array( 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")), - 'S_TOPIC_MOD_LOCK' => ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED)) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? 'lock' : 'unlock') : '', - 'S_TOPIC_MOD_DELETE' => ($auth->acl_get('m_delete', $forum_id)) ? true : false, - 'S_TOPIC_MOD_MOVE' => ($auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED) ? true : false, - 'S_TOPIC_MOD_SPLIT' => ($auth->acl_get('m_split', $forum_id)) ? true : false, - 'S_TOPIC_MOD_MERGE' => ($auth->acl_get('m_merge', $forum_id)) ? true : false, - 'S_TOPIC_MOD_MERGE_TOPIC' => ($auth->acl_get('m_merge', $forum_id)) ? true : false, - 'S_TOPIC_MOD_FORK' => ($auth->acl_get('m_move', $forum_id)) ? true : false, - 'S_TOPIC_MOD_MAKE_NORMAL' => ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? true : false, - 'S_TOPIC_MOD_MAKE_STICKY' => ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) ? true : false, - 'S_TOPIC_MOD_MAKE_ANNOUNCE' => ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) ? true : false, - 'S_TOPIC_MOD_MAKE_GLOBAL' => ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) ? true : false, - 'S_TOPIC_MOD_TOPIC_LOGS' => ($auth->acl_get('m_', $forum_id)), - 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . "&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), 'S_VIEWTOPIC' => true, |