From c5de658c7f15a6ab0028353684323c3ef21521c9 Mon Sep 17 00:00:00 2001 From: callumacrae Date: Fri, 2 Dec 2011 17:26:39 +0000 Subject: [ticket/10510] Moved quick-mod tools markup to template. PHPBB3-10510 --- phpBB/viewtopic.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 7cb6df3660..450ebfeda8 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -517,20 +517,6 @@ 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; -$topic_mod = ''; -$topic_mod .= ($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) ? '' : '') : ''; -$topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '' : ''; -$topic_mod .= ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? '' : ''; -$topic_mod .= ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) ? '' : ''; -$topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) ? '' : ''; -$topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '' : ''; - // 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); @@ -617,7 +603,19 @@ $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' => ($topic_mod != '') ? '' : '', + '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, -- cgit v1.2.1 From 9a07f5287c91549dc989615f0cf6dc1fd8f82e5f Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sun, 4 Mar 2012 10:32:06 +0000 Subject: [ticket/10510] Moved quick-mod tools into a loop. PHPBB3-10510 --- phpBB/viewtopic.php | 106 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 13 deletions(-) (limited to 'phpBB/viewtopic.php') 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, -- cgit v1.2.1 From 4f59990d900b699cdd2cfe4b43e6972bf99d977b Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Fri, 9 Mar 2012 07:34:52 +0000 Subject: [ticket/10510] Added phpbb_add_quickmod_option and moved existing to it. PHPBB3-10510 --- phpBB/viewtopic.php | 110 ++++++++++------------------------------------------ 1 file changed, 21 insertions(+), 89 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 12a611ce6f..717e1515a8 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -517,97 +517,29 @@ 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'] - )); -} +$quickmod_array = array( + 'lock' => array('LOCK_TOPIC', ($topic_data['topic_status'] == ITEM_UNLOCKED) && ($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))), + 'unlock' => array('UNLOCK_TOPIC', ($topic_data['topic_status'] != ITEM_UNLOCKED) && ($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))), + 'delete_topic' => array('DELETE_TOPIC', $auth->acl_get('m_delete', $forum_id)), + 'move' => array('MOVE_TOPIC', $auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED), + 'split' => array('SPLIT_TOPIC', $auth->acl_get('m_split', $forum_id)), + 'merge' => array('MERGE_POSTS', $auth->acl_get('m_merge', $forum_id)), + 'merge_topic' => array('MERGE_TOPIC', $auth->acl_get('m_merge', $forum_id)), + 'fork' => array('FORK_TOPIC', $auth->acl_get('m_move', $forum_id)), + 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)), + 'make_sticky' => array('MAKE_STICKY', ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY)), + 'make_announce' => array('MAKE_ANNOUNCE', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE)), + 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)), + 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)), +); -if ($auth->acl_get('m_', $forum_id)) +foreach($quickmod_array as $option => $qm_ary) { - $template->assign_block_vars('quickmod', array( - 'VALUE' => 'topic_logs', - 'TITLE' => $user->lang['VIEW_TOPIC_LOGS'] - )); + $lang_string = $user->lang[$qm_ary[0]]; + if ((isset($qm_ary[1])) ? $qm_ary[1] : true) + { + phpbb_add_quickmod_option($option, $lang_string); + } } // If we've got a hightlight set pass it on to pagination. -- cgit v1.2.1 From 784c9725f3394ce866ab260485b32d501e07a628 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sun, 11 Mar 2012 19:20:13 +0000 Subject: [ticket/10510] Made a couple improvements to phpbb_add_quickmod_option. PHPBB3-10510 --- phpBB/viewtopic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 717e1515a8..46c25cba81 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -535,8 +535,8 @@ $quickmod_array = array( foreach($quickmod_array as $option => $qm_ary) { - $lang_string = $user->lang[$qm_ary[0]]; - if ((isset($qm_ary[1])) ? $qm_ary[1] : true) + $lang_string = $user->lang($qm_ary[0]); + if (isset($qm_ary[1]) && $qm_ary[1]) { phpbb_add_quickmod_option($option, $lang_string); } -- cgit v1.2.1 From b530a4ede452dc52f8d960cb1e6a608ceca00565 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Mon, 12 Mar 2012 06:40:10 +0000 Subject: [ticket/10510] Shortened an if statement. Replaced an isset() and var check with a !empty. PHPBB3-10510 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 46c25cba81..1c03aae39e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -536,7 +536,7 @@ $quickmod_array = array( foreach($quickmod_array as $option => $qm_ary) { $lang_string = $user->lang($qm_ary[0]); - if (isset($qm_ary[1]) && $qm_ary[1]) + if (!empty($qm_ary[1])) { phpbb_add_quickmod_option($option, $lang_string); } -- cgit v1.2.1 From 79a987ffcb19832e1ddefe8be535b181f8acbd73 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Mon, 12 Mar 2012 07:43:01 +0000 Subject: [ticket/10510] Moved a $user->lang call into the function. PHPBB3-10510 --- phpBB/viewtopic.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1c03aae39e..cf97196e31 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -535,10 +535,9 @@ $quickmod_array = array( foreach($quickmod_array as $option => $qm_ary) { - $lang_string = $user->lang($qm_ary[0]); if (!empty($qm_ary[1])) { - phpbb_add_quickmod_option($option, $lang_string); + phpbb_add_quickmod_option($option, $qm_ary[0]); } } -- cgit v1.2.1 From ddf1a05ad018404f57472068cd533e121343e907 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Thu, 29 Mar 2012 21:09:02 +0100 Subject: [ticket/10510] Added docs to viewtopic quick mod tools array. PHPBB3-10510 --- phpBB/viewtopic.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index cf97196e31..8a95851b7e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -518,6 +518,8 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']); $allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false; $quickmod_array = array( +// 'key' => array('LANG_KEY', $userHasPermissions), + 'lock' => array('LOCK_TOPIC', ($topic_data['topic_status'] == ITEM_UNLOCKED) && ($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))), 'unlock' => array('UNLOCK_TOPIC', ($topic_data['topic_status'] != ITEM_UNLOCKED) && ($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))), 'delete_topic' => array('DELETE_TOPIC', $auth->acl_get('m_delete', $forum_id)), -- cgit v1.2.1 From 8a28456f759747fc34aaf9a6589102fcace3acb6 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sat, 16 Jul 2011 17:53:22 +0100 Subject: [ticket/10273] AJAXified approve / disapprove posts (in viewtopic). This commit AJAXifies the moderator approval functionality, and adds it to viewtopic instead of the MCP. This commit has involved some language changes, which may affect fallbacks. PHPBB3-10273 --- phpBB/viewtopic.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8a95851b7e..1ce80568b6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1534,6 +1534,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_YIM' => $user_cache[$poster_id]['yim'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p={$row['post_id']}&f=$forum_id"), 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $row['post_id']) : '', 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', -- cgit v1.2.1 From 0e55b2393dffa269a724f3090469dad563217dff Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sun, 25 Sep 2011 16:02:26 +0100 Subject: [ticket/10270] Removed all the inline language and HTML from the JS. PHPBB3-10270 --- phpBB/viewtopic.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1ce80568b6..a43edee5da 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -655,6 +655,8 @@ $template->assign_vars(array( 'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&bookmark=1&hash=' . generate_link_hash("topic_$topic_id") : '', 'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], + 'L_BOOKMARK_TOPIC_REAL' => $user->lang['BOOKMARK_TOPIC'], + 'S_BOOKMARKED_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? true : false, 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&f=$forum_id") : '', 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id") : '', -- cgit v1.2.1