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 | |
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')
-rw-r--r-- | phpBB/styles/prosilver/template/viewtopic_body.html | 16 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/viewtopic_body.html | 16 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 106 |
3 files changed, 99 insertions, 39 deletions
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 674f8b1ff4..320d6cb97d 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -259,19 +259,9 @@ <fieldset class="quickmod"> <label for="quick-mod-select">{L_QUICK_MOD}:</label> <select name="action" id="quick-mod-select"> - <!-- IF S_TOPIC_MOD_LOCK eq 'lock' --><option value="lock">{L_LOCK_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_LOCK eq 'unlock' --><option value="unlock">{L_UNLOCK_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_DELETE --><option value="delete_topic">{L_DELETE_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MOVE --><option value="move">{L_MOVE_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_SPLIT--><option value="split">{L_SPLIT_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MERGE --><option value="merge">{L_MERGE_POSTS}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MERGE_TOPIC --><option value="merge_topic">{L_MERGE_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_FORK --><option value="fork">{L_FORK_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_NORMAL --><option value="make_normal">{L_MAKE_NORMAL}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_STICKY --><option value="make_sticky">{L_MAKE_STICKY}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_ANNOUNCE --><option value="make_announce">{L_MAKE_ANNOUNCE}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_GLOBAL --><option value="make_global">{L_MAKE_GLOBAL}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_TOPIC_LOGS --><option value="topic_logs">{L_VIEW_TOPIC_LOGS}</option><!-- ENDIF --> + <!-- BEGIN quickmod --> + <option value="{quickmod.VALUE}">{quickmod.TITLE}</option> + <!-- END quickmod --> </select> <input type="submit" value="{L_GO}" class="button2" /> {S_FORM_TOKEN} diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index a431d51c79..f696254249 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -352,19 +352,9 @@ <form method="post" action="{S_MOD_ACTION}"> <span class="gensmall">{L_QUICK_MOD}:</span> <select name="action" id="quick-mod-select"> - <!-- IF S_TOPIC_MOD_LOCK eq 'lock' --><option value="lock">{L_LOCK_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_LOCK eq 'unlock' --><option value="unlock">{L_UNLOCK_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_DELETE --><option value="delete_topic">{L_DELETE_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MOVE --><option value="move">{L_MOVE_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_SPLIT--><option value="split">{L_SPLIT_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MERGE --><option value="merge">{L_MERGE_POSTS}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MERGE_TOPIC --><option value="merge_topic">{L_MERGE_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_FORK --><option value="fork">{L_FORK_TOPIC}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_NORMAL --><option value="make_normal">{L_MAKE_NORMAL}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_STICKY --><option value="make_sticky">{L_MAKE_STICKY}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_ANNOUNCE --><option value="make_announce">{L_MAKE_ANNOUNCE}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_MAKE_GLOBAL --><option value="make_global">{L_MAKE_GLOBAL}</option><!-- ENDIF --> - <!-- IF S_TOPIC_MOD_TOPIC_LOGS --><option value="topic_logs">{L_VIEW_TOPIC_LOGS}</option><!-- ENDIF --> + <!-- BEGIN quickmod --> + <option value="{quickmod.VALUE}">{quickmod.TITLE}</option> + <!-- END quickmod --> </select> <input class="btnlite" type="submit" value="{L_GO}" /> </form> 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, |