diff options
-rw-r--r-- | phpBB/adm/style/ajax.js | 19 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 3 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 4 | ||||
-rw-r--r-- | phpBB/language/en/viewtopic.php | 3 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/navbar_header.html | 49 | ||||
-rw-r--r-- | tests/text_formatter/s9e/default_formatting_test.php | 10 | ||||
-rw-r--r-- | tests/text_processing/tickets_data/PHPBB3-11742.html | 2 |
8 files changed, 66 insertions, 30 deletions
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 895bb056e5..9d9fc62254 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -173,7 +173,9 @@ function submitPermissions() { var permissionSubmitSize = 0, permissionRequestCount = 0, forumIds = [], - permissionSubmitFailed = false; + permissionSubmitFailed = false, + clearIndicator = true, + $loadingIndicator; if ($submitAllButton !== $submitButton) { fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id); @@ -207,6 +209,8 @@ function submitPermissions() { } }); + $loadingIndicator = phpbb.loadingIndicator(); + /** * Handler for submitted permissions form chunk * @@ -222,6 +226,8 @@ function submitPermissions() { } else if (!permissionSubmitFailed && res.S_USER_NOTICE) { // Display success message at the end of submitting the form if (permissionRequestCount >= permissionSubmitSize) { + clearIndicator = true; + var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); var $alertBoxLink = $alert.find('p.alert_text > a'); @@ -271,6 +277,17 @@ function submitPermissions() { $form.submit(); }, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds } + } else { + // Still more forms to submit, so do not clear indicator + clearIndicator = false; + } + } + + if (clearIndicator) { + phpbb.clearLoadingTimeout(); + + if ($loadingIndicator) { + $loadingIndicator.fadeOut(phpbb.alertTime); } } } diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index bd8df6a63b..a74bf03b1e 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -226,6 +226,12 @@ class acp_bbcodes trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); } + /** + * Replace Emojis and other 4bit UTF-8 chars not allowed by MySQL to UCR/NCR. + * Using their Numeric Character Reference's Hexadecimal notation. + */ + $bbcode_helpline = utf8_encode_ucr($bbcode_helpline); + $sql_ary = array_merge($sql_ary, array( 'bbcode_tag' => $data['bbcode_tag'], 'bbcode_match' => $bbcode_match, diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e4adce14fc..0f6efca34e 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1114,6 +1114,9 @@ function display_custom_bbcodes() $row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])]; } + // Convert Numeric Character References to UTF-8 chars. + $row['bbcode_helpline'] = utf8_decode_ncr($row['bbcode_helpline']); + $custom_tags = array( 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 3ba63746c8..6a27e6b89d 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -167,6 +167,7 @@ $lang = array_merge($lang, array( ), 'COLLAPSE_VIEW' => 'Collapse view', 'CLOSE_WINDOW' => 'Close window', + 'CODE' => 'Code', 'COLOUR_SWATCH' => 'Colour swatch', 'COLON' => ':', 'COMMA_SEPARATOR' => ', ', // Comma used to join lists into a single string, use localised comma if appropriate, eg: Ideographic or Arabic @@ -605,6 +606,9 @@ $lang = array_merge($lang, array( 'POST_UNAPPROVED_ACTION' => 'Post awaiting approval:', 'POST_UNAPPROVED' => 'This post has not been approved.', 'POWERED_BY' => 'Powered by %s', + + 'QUOTE' => 'Quote', + 'PREVIEW' => 'Preview', 'PREVIOUS' => 'Previous', // Used in pagination 'PREVIOUS_STEP' => 'Previous', diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index 5d127acb3d..e5c9be0517 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -49,8 +49,6 @@ $lang = array_merge($lang, array( 'BUMPED_BY' => 'Last bumped by %1$s on %2$s.', 'BUMP_TOPIC' => 'Bump topic', - 'CODE' => 'Code', - 'DELETE_TOPIC' => 'Delete topic', 'DELETED_INFORMATION' => 'Deleted by %1$s on %2$s', 'DISAPPROVE' => 'Disapprove', @@ -98,7 +96,6 @@ $lang = array_merge($lang, array( 'QUICK_MOD' => 'Quick-mod tools', 'QUICKREPLY' => 'Quick Reply', - 'QUOTE' => 'Quote', 'REPLY_TO_TOPIC' => 'Reply to topic', 'RESTORE' => 'Restore', diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index 77f5dae0c0..bd54f71d41 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -178,32 +178,41 @@ </ul> <ul id="nav-breadcrumbs" class="nav-breadcrumbs linklist navlinks" role="menubar"> - <!-- DEFINE $MICRODATA = ' itemtype="http://schema.org/ListItem" itemprop="itemListElement" itemscope' --> + {% set MICRODATA = 'itemtype="https://schema.org/ListItem" itemprop="itemListElement" itemscope' %} {% set navlink_position = 1 %} - <!-- EVENT overall_header_breadcrumbs_before --> - <li class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList"> - <!-- IF U_SITE_HOME --> - <span class="crumb" {$MICRODATA}><a href="{U_SITE_HOME}" itemtype="https://schema.org/Thing" itemscope itemprop="item" data-navbar-reference="home"><i class="icon fa-home fa-fw" aria-hidden="true"></i><span itemprop="name">{L_SITE_HOME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> - <!-- ENDIF --> - <!-- EVENT overall_header_breadcrumb_prepend --> - <span class="crumb" {$MICRODATA}><a href="{U_INDEX}" itemtype="https://schema.org/Thing" itemscope itemprop="item" accesskey="h" data-navbar-reference="index"><!-- IF not U_SITE_HOME --><i class="icon fa-home fa-fw"></i><!-- ENDIF --><span itemprop="name">{L_INDEX}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> - - <!-- BEGIN navlinks --> - <!-- EVENT overall_header_navlink_prepend --> - <span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemtype="https://schema.org/Thing" itemscope itemprop="item"><span itemprop="name">{navlinks.FORUM_NAME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> - <!-- EVENT overall_header_navlink_append --> - <!-- END navlinks --> - <!-- EVENT overall_header_breadcrumb_append --> + + {% EVENT overall_header_breadcrumbs_before %} + + <li class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList"> + + {% if U_SITE_HOME %} + <span class="crumb" {{ MICRODATA }}><a itemprop="item" href="{{ U_SITE_HOME }}" data-navbar-reference="home"><i class="icon fa-home fa-fw" aria-hidden="true"></i><span itemprop="name">{{ L_SITE_HOME }}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> + {% endif %} + + {% EVENT overall_header_breadcrumb_prepend %} + <span class="crumb" {{ MICRODATA }}><a itemprop="item" href="{{ U_INDEX }}" accesskey="h" data-navbar-reference="index">{% if not U_SITE_HOME %}<i class="icon fa-home fa-fw"></i>{% endif %}<span itemprop="name">{{ L_INDEX }}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> + + {% for navlinks in navlinks %} + {% set NAVLINK_NAME = navlinks.BREADCRUMB_NAME | default(navlinks.FORUM_NAME) %} + {% set NAVLINK_LINK = navlinks.U_BREADCRUMB | default(navlinks.U_VIEW_FORUM) %} + + {% EVENT overall_header_navlink_prepend %} + <span class="crumb" {{ MICRODATA }}{% if navlinks.MICRODATA %} {{ navlinks.MICRODATA }}{% endif %}><a itemprop="item" href="{{ NAVLINK_LINK }}"><span itemprop="name">{{ NAVLINK_NAME }}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> + {% EVENT overall_header_navlink_append %} + {% endfor %} + + {% EVENT overall_header_breadcrumb_append %} </li> - <!-- EVENT overall_header_breadcrumbs_after --> - <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --> + {% EVENT overall_header_breadcrumbs_after %} + + {% if S_DISPLAY_SEARCH and not S_IN_SEARCH %} <li class="rightside responsive-search"> - <a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}" role="menuitem"> - <i class="icon fa-search fa-fw" aria-hidden="true"></i><span class="sr-only">{L_SEARCH}</span> + <a href="{{ U_SEARCH }}" title="{{ lang('SEARCH_ADV_EXPLAIN') }}" role="menuitem"> + <i class="icon fa-search fa-fw" aria-hidden="true"></i><span class="sr-only">{{ lang('SEARCH') }}</span> </a> </li> - <!-- ENDIF --> + {% endif %} </ul> </div> diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php index 1aa4f0bc3a..ce15a52adc 100644 --- a/tests/text_formatter/s9e/default_formatting_test.php +++ b/tests/text_formatter/s9e/default_formatting_test.php @@ -82,7 +82,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case ), array( '[code]unparsed code[/code]', - '<div class="codebox"><p>CODE: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>unparsed code</code></pre></div>' + '<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>unparsed code</code></pre></div>' ), array( '[list]no item[/list]', @@ -195,12 +195,12 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case array( // Do not parse textual bbcodes in code '[code]unparsed code [b]bold [i]bold + italic[/i][/b][/code]', - '<div class="codebox"><p>CODE: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>unparsed code [b]bold [i]bold + italic[/i][/b]</code></pre></div>' + '<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>unparsed code [b]bold [i]bold + italic[/i][/b]</code></pre></div>' ), array( // Do not parse quote bbcodes in code '[code]unparsed code [quote="username"]quoted[/quote][/code]', - '<div class="codebox"><p>CODE: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>unparsed code [quote="username"]quoted[/quote]</code></pre></div>' + '<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>unparsed code [quote="username"]quoted[/quote]</code></pre></div>' ), array( // Textual bbcode nesting into textual bbcode @@ -209,11 +209,11 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case ), array( "[code]\tline1\n line2[/code]", - '<div class="codebox"><p>CODE: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>' . "\tline1\n line2</code></pre></div>" + '<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>' . "\tline1\n line2</code></pre></div>" ), array( "[code]\n\tline1\n line2[/code]", - '<div class="codebox"><p>CODE: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>' . "\tline1\n line2</code></pre></div>" + '<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>' . "\tline1\n line2</code></pre></div>" ), array( '... http://example.org ...', diff --git a/tests/text_processing/tickets_data/PHPBB3-11742.html b/tests/text_processing/tickets_data/PHPBB3-11742.html index e7890eef19..5ce263f4f9 100644 --- a/tests/text_processing/tickets_data/PHPBB3-11742.html +++ b/tests/text_processing/tickets_data/PHPBB3-11742.html @@ -1 +1 @@ -<div class="codebox"><p>CODE: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code> tab</code></pre></div>
\ No newline at end of file +<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code> tab</code></pre></div>
\ No newline at end of file |