From 90a8c7e29af020050b589fb8b7485fb9ac67fc7e Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sat, 9 Nov 2013 22:06:20 -0800 Subject: [PATCH 01/11] [ticket/12013] Use new dropdown for quickmod tools and jumpbox. PHPBB3-12013 --- phpBB/includes/functions_content.php | 18 ++++++----- phpBB/styles/prosilver/template/ajax.js | 31 ------------------- phpBB/styles/prosilver/template/jumpbox.html | 29 +++++++++-------- .../prosilver/template/viewforum_body.html | 1 + .../prosilver/template/viewtopic_body.html | 22 +++++++------ phpBB/viewtopic.php | 17 ++++++++-- 6 files changed, 53 insertions(+), 65 deletions(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 09bd3e6cdb..f631b91e8d 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -174,8 +174,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list $template->assign_block_vars('jumpbox_forums', array( 'FORUM_ID' => ($select_all) ? 0 : -1, 'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'], - 'S_FORUM_COUNT' => $iteration) - ); + 'S_FORUM_COUNT' => $iteration, + 'LINK' => phpbb_append_url_param($action, 'f', $forum_id), + )); $iteration++; $display_jumpbox = true; @@ -188,8 +189,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list 'S_FORUM_COUNT' => $iteration, 'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, - 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false) - ); + 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false, + 'LINK' => phpbb_append_url_param($action, 'f', $row['forum_id']), + )); for ($i = 0; $i < $padding; $i++) { @@ -1452,16 +1454,18 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', /** * Add an option to the quick-mod tools. * + * @param string $url The recepting URL for the quickmod actions. * @param string $option The language key for the value of the option. * @param string $lang_string The language string to use. */ -function phpbb_add_quickmod_option($option, $lang_string) +function phpbb_add_quickmod_option($url, $option, $lang_string) { global $template, $user; $lang_string = $user->lang($lang_string); $template->assign_block_vars('quickmod', array( - 'VALUE' => $option, - 'TITLE' => $lang_string, + 'VALUE' => $option, + 'TITLE' => $lang_string, + 'LINK' => phpbb_append_url_param($url, 'action', $option), )); } diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index e9f8064b9e..70bc703582 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -356,37 +356,6 @@ $('.display_post').click(function(e) { $('#post_hidden' + post_id).hide(); }); - - -/** - * This AJAXifies the quick-mod tools. The reason it cannot be a standard - * callback / data attribute is that it requires filtering - some of the options - * can be ajaxified, while others cannot. - */ -phpbb.ajaxify({ - selector: '#quickmodform', - refresh: true, - filter: function (data) { - var action = $('#quick-mod-select').val(); - - if (action === 'make_normal') { - return $(this).find('select option[value="make_global"]').length > 0; - } else if (action === 'lock' || action === 'unlock') { - return true; - } - - if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') { - return true; - } - - return false; - } -}); - -$('#quick-mod-select').change(function () { - $('#quickmodform').submit(); -}); - $('#delete_permanent').click(function () { if ($(this).prop('checked')) { $('#delete_reason').hide(); diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 47d322407d..420fd62202 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -10,24 +10,23 @@ -
- -
- -
- - {HIDDEN_FIELDS_FOR_JUMPBOX} - - - -
- + + +

diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index a3fb8aa6da..7478ba4e28 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -242,6 +242,7 @@ +
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 481305e0d7..8d5e5f44bc 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -367,19 +367,21 @@ -
-
- - - - {S_FORM_TOKEN} -
-
+ +
+ + +
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d87f7de2b0..c9f70c87e8 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -523,6 +523,19 @@ 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; +$s_quickmod_action = append_sid( + "{$phpbb_root_path}mcp.$phpEx", + array( + 'f' => $forum_id, + 't' => $topic_id, + 'start' => $start, + 'quickmod' => 1, + 'redirect' => urlencode(str_replace('&', '&', $viewtopic_url)), + ), + true, + $user->session_id +); + $quickmod_array = array( // 'key' => array('LANG_KEY', $userHasPermissions), @@ -546,7 +559,7 @@ foreach($quickmod_array as $option => $qm_ary) { if (!empty($qm_ary[1])) { - phpbb_add_quickmod_option($option, $qm_ary[0]); + phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]); } } @@ -631,7 +644,7 @@ $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_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_MOD_ACTION' => $s_quickmod_action, 'L_RETURN_TO_FORUM' => $user->lang('RETURN_TO', $topic_data['forum_name']), 'S_VIEWTOPIC' => true, From 2ff8302c51a4219deacbe6b79a0d58c3d619dee3 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 11 Apr 2014 20:11:03 -0700 Subject: [PATCH 02/11] [ticket/12013] Use path helper. PHPBB3-12013 --- phpBB/includes/functions_content.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index f631b91e8d..d1a001110f 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -175,7 +175,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list 'FORUM_ID' => ($select_all) ? 0 : -1, 'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'], 'S_FORUM_COUNT' => $iteration, - 'LINK' => phpbb_append_url_param($action, 'f', $forum_id), + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)), )); $iteration++; @@ -190,7 +190,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list 'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false, - 'LINK' => phpbb_append_url_param($action, 'f', $row['forum_id']), + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)), )); for ($i = 0; $i < $padding; $i++) @@ -1460,12 +1460,13 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', */ function phpbb_add_quickmod_option($url, $option, $lang_string) { - global $template, $user; + global $template, $user, $phpbb_path_helper; + $lang_string = $user->lang($lang_string); $template->assign_block_vars('quickmod', array( 'VALUE' => $option, 'TITLE' => $lang_string, - 'LINK' => phpbb_append_url_param($url, 'action', $option), + 'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)), )); } From 35fab0fc72a2cc1fb473a10295f10539d176e9df Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 11 Apr 2014 20:13:30 -0700 Subject: [PATCH 03/11] [ticket/12013] Use DEFINE instead of Twig's set. PHPBB3-12013 --- phpBB/styles/prosilver/template/viewtopic_body.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 8d5e5f44bc..0b54e6cb9b 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -373,8 +373,8 @@
From e1513a985bd8c2e088f6d31232c516b6df1d4538 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 2 May 2014 14:40:34 -0700 Subject: [PATCH 04/11] [ticket/12013] Use the correct variable for the forum id. PHPBB3-12013 --- phpBB/includes/functions_content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index d1a001110f..ee78364083 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -190,7 +190,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list 'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false, - 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)), + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])), )); for ($i = 0; $i < $padding; $i++) From bf5d3030b417b23840de39e5e01ea0fcbdda54b2 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 2 May 2014 14:45:34 -0700 Subject: [PATCH 05/11] [ticket/12013] Add missing class to place the buttons on the rightside. PHPBB3-12013 --- phpBB/styles/prosilver/theme/common.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 881b2357b0..b4685a6312 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -477,6 +477,10 @@ ul.linklist.bulletin > li.no-bulletin:before { position: relative; } +.dropdown-container-right { + float: right; +} + .nojs .dropdown-container:hover .dropdown { display: block !important; } From 3bfc9ccbc7472e2f000e70c7a9ab3a93dcbd30d7 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sat, 31 May 2014 16:25:20 -0700 Subject: [PATCH 06/11] [ticket/12013] Update to use the new .button class. PHPBB3-12013 --- phpBB/styles/prosilver/template/jumpbox.html | 5 ++--- phpBB/styles/prosilver/template/viewtopic_body.html | 4 ++-- phpBB/styles/prosilver/theme/buttons.css | 8 ++++++-- phpBB/styles/prosilver/theme/colours.css | 4 ++++ phpBB/styles/prosilver/theme/common.css | 4 ++++ 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 420fd62202..2ddc8423c6 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -11,10 +11,9 @@ -