diff --git a/.gitignore b/.gitignore index df389eda1f..9e7fc2f0d0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ /phpBB/store/* /phpBB/styles/* !/phpBB/styles/prosilver -/phpBB/styles/prosilver/theme/*/ !/phpBB/styles/prosilver/theme/en !/phpBB/styles/prosilver/theme/images !/phpBB/styles/all diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 4d2544de58..3c0bcf2243 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1052,11 +1052,11 @@ phpbb.addAjaxCallback('alt_text', function() { * and changes the link itself. */ phpbb.addAjaxCallback('toggle_link', function() { - var $anchor, - updateAll = $(this).data('update-all') , - toggleText, - toggleUrl, - toggleClass; + var $anchor; + var updateAll = $(this).data('update-all'); + var toggleText; + var toggleUrl; + var toggleIcon; if (updateAll !== undefined && updateAll.length) { $anchor = $(updateAll); @@ -1067,21 +1067,19 @@ phpbb.addAjaxCallback('toggle_link', function() { $anchor.each(function() { var $this = $(this); + // Toggle link text + toggleText = $.trim($this.attr('data-toggle-text')); + $this.attr('data-toggle-text', $.trim($this.children('span').text())); + $this.attr('title', toggleText); + $this.children('span').last().text(toggleText); + // Toggle link url toggleUrl = $this.attr('data-toggle-url'); $this.attr('data-toggle-url', $this.attr('href')); $this.attr('href', toggleUrl); - // Toggle class of link parent - toggleClass = $this.attr('data-toggle-class'); - $this.attr('data-toggle-class', $this.children().attr('class')); - $this.children('.icon').attr('class', toggleClass); - - // Toggle link text - toggleText = $this.attr('data-toggle-text'); - $this.attr('data-toggle-text', $this.children('span').text()); - $this.attr('title', $.trim(toggleText)); - $this.children('span').text(toggleText); + // Toggle Icon + $this.children().first().toggleClass('is-active').next().toggleClass('is-active') }); }); @@ -1381,7 +1379,7 @@ phpbb.dropdownVisibleContainers = '.dropdown-container.dropdown-visible'; * Dropdown toggle event handler * This handler is used by phpBB.registerDropdown() and other functions */ -phpbb.toggleDropdown = function() { +phpbb.toggleDropdown = function(event_) { var $this = $(this), options = $this.data('dropdown-options'), parent = options.parent, @@ -1389,6 +1387,9 @@ phpbb.toggleDropdown = function() { direction; if (!visible) { + // Prevent link default action + event_.preventDefault(); + event_.stopPropagation(); // Hide other dropdown menus $(phpbb.dropdownHandles).each(phpbb.toggleDropdown); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4999d1f0f5..b0f3f3caf2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3933,6 +3933,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data), 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), + 'CURRENT_USER_GROUP_COLOR' => $user->data['user_colour'], 'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', 'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', 'U_VIEW_ALL_NOTIFICATIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications'), diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 19f71e092a..d6a3c43c89 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -270,11 +270,17 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row_ary['forum_id']) && $row_ary['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), + 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'TOPIC_ICON_IMG' => (!empty($icons[$row_ary['icon_id']])) ? $icons[$row_ary['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row_ary['icon_id']])) ? $icons[$row_ary['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row_ary['icon_id']])) ? $icons[$row_ary['icon_id']]['height'] : '', 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'DELETED_IMG' => ($topic_deleted) ? $user->img('icon_topic_deleted', 'TOPIC_DELETED') : '', + 'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false, + 'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false, + 'S_POST_STICKY' => ($row['topic_type'] == POST_STICKY) ? true : false, + 'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false, + 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, 'TOPIC_AUTHOR' => get_username_string('username', $row_ary['topic_poster'], $row_ary['topic_first_poster_name'], $row_ary['topic_first_poster_colour']), 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row_ary['topic_poster'], $row_ary['topic_first_poster_name'], $row_ary['topic_first_poster_colour']), diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 42985b3c79..5ae1f8ff40 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -246,6 +246,7 @@ function mcp_post_details($id, $mode, $action) 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']), 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), + 'MINI_POST' => ($post_unread) ? $user->lang['UNREAD_POST'] : $user->lang['POST'], 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '", ''), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '', ''), diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 36f45f3f46..a258f51431 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -977,6 +977,11 @@ class ucp_main 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false, + 'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false, + 'S_POST_STICKY' => ($row['topic_type'] == POST_STICKY) ? true : false, + 'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false, + 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false, diff --git a/phpBB/phpbb/template/twig/extension/icon.php b/phpBB/phpbb/template/twig/extension/icon.php index f96ed94821..3869c63b2e 100644 --- a/phpBB/phpbb/template/twig/extension/icon.php +++ b/phpBB/phpbb/template/twig/extension/icon.php @@ -165,6 +165,7 @@ class icon extends \Twig\Extension\AbstractExtension 'ICON' => (string) $icon, 'SOURCE' => (string) $source, 'TITLE' => (string) $title, + 'TITLE_ID' => $title && $type === 'svg' ? unique_id() : '', 'VIEW_BOX' => (string) $view_box, 'S_HIDDEN' => (bool) $hidden, ]); @@ -258,7 +259,7 @@ class icon extends \Twig\Extension\AbstractExtension * 'lock': topicrow.S_TOPIC_LOCKED, * 'fire': topicrow.S_TOPIC_HOT, * 'file': true, - * }, 'MY_TITLE', true) }} + * }, lang('MY_TITLE'), true) }} * * @param array $icons Array of icons and their booleans * @return string The first 'true' icon diff --git a/phpBB/search.php b/phpBB/search.php index 678b4d9ff8..b2a8aa2c3a 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1122,6 +1122,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], + 'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false, + 'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false, + 'S_POST_STICKY' => ($row['topic_type'] == POST_STICKY) ? true : false, + 'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false, + 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', diff --git a/phpBB/styles/all/template/macros/icons/font.twig b/phpBB/styles/all/template/macros/icons/font.twig index a882a25c40..9a350f8f03 100644 --- a/phpBB/styles/all/template/macros/icons/font.twig +++ b/phpBB/styles/all/template/macros/icons/font.twig @@ -1,4 +1,3 @@ -{% spaceless %} - - {% if TITLE %}{{ lang(TITLE) }}{% endif %} -{% endspaceless %} +{% apply spaceless %} + {% if TITLE %}{{ lang(TITLE) }}{% endif %} +{% endapply %} diff --git a/phpBB/styles/all/template/macros/icons/iconify.twig b/phpBB/styles/all/template/macros/icons/iconify.twig index 43b8b88948..9287bbaf8e 100644 --- a/phpBB/styles/all/template/macros/icons/iconify.twig +++ b/phpBB/styles/all/template/macros/icons/iconify.twig @@ -1,4 +1,4 @@ -{% spaceless %} - - {% if TITLE %}{{ lang(TITLE) }}{% endif %} -{% endspaceless %} +{% apply spaceless %} + +{% if TITLE %}{{ TITLE }}{% endif %} +{% endapply %} diff --git a/phpBB/styles/all/template/macros/icons/png.twig b/phpBB/styles/all/template/macros/icons/png.twig index 426f7a3a5e..38e36efe72 100644 --- a/phpBB/styles/all/template/macros/icons/png.twig +++ b/phpBB/styles/all/template/macros/icons/png.twig @@ -1,3 +1,3 @@ -{% spaceless %} - {{ lang(TITLE) }} -{% endspaceless %} +{% apply spaceless %} + {{ TITLE }} +{% endapply %} diff --git a/phpBB/styles/all/template/macros/icons/svg.twig b/phpBB/styles/all/template/macros/icons/svg.twig index e24777272e..f84b6f3e71 100644 --- a/phpBB/styles/all/template/macros/icons/svg.twig +++ b/phpBB/styles/all/template/macros/icons/svg.twig @@ -1,9 +1,7 @@ -{% spaceless %} - {% set TITLE_ID = TITLE ? TITLE|lower|replace({' ': '_'}) ~ '-' ~ random() %} - +{% apply spaceless %} -{% endspaceless %} +{% endapply %} diff --git a/phpBB/styles/prosilver/template/display_options.html b/phpBB/styles/prosilver/template/display_options.html index 1bcaf40087..db55be9737 100644 --- a/phpBB/styles/prosilver/template/display_options.html +++ b/phpBB/styles/prosilver/template/display_options.html @@ -1,7 +1,9 @@