From 8817e234747375fc01276f01fbc3c949ef24d52b Mon Sep 17 00:00:00 2001 From: lavigor Date: Wed, 6 Jun 2018 12:39:51 +0300 Subject: [PATCH] [ticket/13713] Make mentions globally available PHPBB3-13713 --- phpBB/adm/style/acp_posting_buttons.html | 5 +++ phpBB/adm/style/admin.css | 46 ++++++++++++++++++++++++ phpBB/includes/functions.php | 2 ++ phpBB/includes/functions_acp.php | 5 +++ phpBB/posting.php | 1 - 5 files changed, 58 insertions(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_posting_buttons.html b/phpBB/adm/style/acp_posting_buttons.html index dfe09ae12e..be15ab40d3 100644 --- a/phpBB/adm/style/acp_posting_buttons.html +++ b/phpBB/adm/style/acp_posting_buttons.html @@ -1,5 +1,7 @@ + + + diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 2a5eacfcd7..620a658167 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1670,6 +1670,52 @@ fieldset.submit-buttons legend { } } +/* Mentions and mention dropdown +---------------------------------------- */ +.mention { + font-weight: bold; +} + +.atwho-container .atwho-view { + font-size: 12px; + min-width: 260px; +} + +.atwho-container .atwho-view ul li { + position: relative; + padding: 15px 5px 15px 45px; +} + +.atwho-container .atwho-view ul li:hover, +.atwho-container .atwho-view ul li.cur { + background-color: #0077b3; + color: #ffffff; +} + +.mention-avatar { + font-size: 14px; + line-height: 30px; + text-align: center; + vertical-align: middle; + background-color: #0077b3; + border: 1px solid #ffffff; + border-radius: 100%; + color: #ffffff; + position: absolute; + top: 50%; + left: 7px; + display: inline-block; + width: 30px; + height: 30px; + margin-top: -16px; +} + +.mention-rank { + font-size: 10px; + display: block; + margin-top: 2px; +} + /* Input field styles ---------------------------------------- */ input.radio, diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 337242bcd7..adc09b9382 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3943,6 +3943,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '', 'U_FEED' => $controller_helper->route('phpbb_feed_index'), + 'UA_MENTION_URL' => $controller_helper->route('phpbb_mention_controller'), + 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false, 'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false, diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index ff2a8badb8..ce6712ffd0 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -66,6 +66,9 @@ function adm_page_header($page_title) } } + /** @var \phpbb\controller\helper $controller_helper */ + $controller_helper = $phpbb_container->get('controller.helper'); + $phpbb_version_parts = explode('.', PHPBB_VERSION, 3); $phpbb_major = $phpbb_version_parts[0] . '.' . $phpbb_version_parts[1]; @@ -86,6 +89,8 @@ function adm_page_header($page_title) 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"), 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), + 'UA_MENTION_URL' => $controller_helper->route('phpbb_mention_controller'), + 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/", 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/", diff --git a/phpBB/posting.php b/phpBB/posting.php index 7c29f205f5..696c3346cb 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1905,7 +1905,6 @@ $page_data = array( 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") : '', 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup"), 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup")), - 'UA_MENTION_URL' => $controller_helper->route('phpbb_mention_controller'), 'S_PRIVMSGS' => false, 'S_CLOSE_PROGRESS_WINDOW' => (isset($_POST['add_file'])) ? true : false,