diff options
Diffstat (limited to 'phpBB/adm')
-rw-r--r-- | phpBB/adm/style/acp_ext_details.html | 25 | ||||
-rw-r--r-- | phpBB/adm/style/acp_ext_list.html | 4 | ||||
-rw-r--r-- | phpBB/adm/style/acp_help_phpbb.html | 61 | ||||
-rw-r--r-- | phpBB/adm/style/acp_main.html | 5 | ||||
-rw-r--r-- | phpBB/adm/style/acp_profile.html | 1 | ||||
-rw-r--r-- | phpBB/adm/style/acp_send_statistics.html | 64 | ||||
-rw-r--r-- | phpBB/adm/style/acp_styles.html | 4 | ||||
-rw-r--r-- | phpBB/adm/style/acp_update.html | 5 | ||||
-rw-r--r-- | phpBB/adm/style/admin.css | 119 | ||||
-rw-r--r-- | phpBB/adm/style/admin.js | 14 | ||||
-rw-r--r-- | phpBB/adm/style/ajax.js | 243 | ||||
-rw-r--r-- | phpBB/adm/style/overall_header.html | 3 | ||||
-rw-r--r-- | phpBB/adm/style/simple_header.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/tooltip.js | 17 |
14 files changed, 482 insertions, 85 deletions
diff --git a/phpBB/adm/style/acp_ext_details.html b/phpBB/adm/style/acp_ext_details.html index 830c2e3cb4..d7839f7ec8 100644 --- a/phpBB/adm/style/acp_ext_details.html +++ b/phpBB/adm/style/acp_ext_details.html @@ -7,19 +7,17 @@ <h1>{L_EXTENSIONS_ADMIN}</h1> <!-- IF S_VERSIONCHECK --> - <div class="<!-- IF S_UP_TO_DATE -->successbox<!-- ELSE -->errorbox<!-- ENDIF -->"> - <p>{UP_TO_DATE_MSG} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p> - </div> - <!-- ELSE IF S_VERSIONCHECK_STATUS == 0 --> - <div class="errorbox notice"> - <p>{L_VERSIONCHECK_FAIL}</p> - <p>{VERSIONCHECK_FAIL_REASON}</p> - <p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p> - </div> - <!-- ELSE IF S_VERSIONCHECK_STATUS == 1 --> - <div class="errorbox notice"> - <p>{VERSIONCHECK_FAIL_REASON}</p> - </div> + <!-- IF S_VERSIONCHECK_FAIL --> + <div class="errorbox notice"> + <p>{L_VERSIONCHECK_FAIL}</p> + <p>{VERSIONCHECK_FAIL_REASON}</p> + <p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p> + </div> + <!-- ELSE --> + <div class="<!-- IF S_UP_TO_DATE -->successbox<!-- ELSE -->errorbox<!-- ENDIF -->"> + <p>{UP_TO_DATE_MSG} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p> + </div> + <!-- ENDIF --> <!-- ENDIF --> <fieldset> @@ -136,4 +134,5 @@ <!-- END meta_authors --> </fieldset> + <!-- EVENT acp_ext_details_end --> <!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index ccc39ea76d..af9e00a614 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -48,7 +48,7 @@ </tr> <!-- BEGIN enabled --> <tr class="ext_enabled row-highlight"> - <td><strong title="{enabled.NAME}">{enabled.META_DISPLAY_NAME}</strong></td> + <td><strong title="{enabled.NAME}">{enabled.META_DISPLAY_NAME}</strong><!-- EVENT acp_ext_list_enabled_name_after --></td> <td style="text-align: center;"> <!-- IF enabled.S_VERSIONCHECK --> <strong <!-- IF enabled.S_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF -->>{enabled.META_VERSION}</strong> @@ -73,7 +73,7 @@ </tr> <!-- BEGIN disabled --> <tr class="ext_disabled row-highlight"> - <td><strong title="{disabled.NAME}">{disabled.META_DISPLAY_NAME}</strong></td> + <td><strong title="{disabled.NAME}">{disabled.META_DISPLAY_NAME}</strong><!-- EVENT acp_ext_list_disabled_name_after --></td> <td style="text-align: center;"> <!-- IF disabled.S_VERSIONCHECK --> <strong <!-- IF disabled.S_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF -->>{disabled.META_VERSION}</strong> diff --git a/phpBB/adm/style/acp_help_phpbb.html b/phpBB/adm/style/acp_help_phpbb.html new file mode 100644 index 0000000000..478ecc162a --- /dev/null +++ b/phpBB/adm/style/acp_help_phpbb.html @@ -0,0 +1,61 @@ +<!-- INCLUDE overall_header.html --> + +<a id="maincontent"></a> + +<h1>{L_ACP_HELP_PHPBB}</h1> + +<form id="acp_help_phpbb" method="post" action="{U_ACTION}" data-ajax-action="{U_COLLECT_STATS}"> +<div class="send-stats-row"> + <!-- EVENT acp_help_phpbb_stats_before --> + <div class="send-stats-tile"> + <h2><i class="icon fa-bar-chart"></i>{L_SEND_STATISTICS}</h2> + <p>{L_EXPLAIN_SEND_STATISTICS}</p> + <div class="send-stats-row"> + <div class="send-stats-data-row send-stats-data-only-row"> + <a id="trigger-configlist" data-ajax="toggle_link" data-overlay="false" data-toggle-text="{L_HIDE_STATISTICS}"><span>{L_SHOW_STATISTICS}</span><i class="icon fa-angle-down"></i></a> + </div> + <div class="send-stats-data-row"> + <div class="configlist" id="configlist"> + <!-- BEGIN providers --> + <fieldset> + <legend>{providers.NAME}</legend> + <!-- BEGIN values --> + <dl> + <dt>{providers.values.KEY}</dt> + <dd>{providers.values.VALUE}</dd> + </dl> + <!-- END values --> + </fieldset> + <!-- END providers --> + </div> + </div> + </div> + <dl class="send-stats-settings"> + <dt> + <input name="help_send_statistics" id="help_send_statistics" type="checkbox"<!-- IF S_COLLECT_STATS --> checked="checked"<!-- ENDIF --> /> + <label for="help_send_statistics"></label> + </dt> + <dd>{L_SEND_STATISTICS_LONG}</dd> + </dl> + </div> + <!-- EVENT acp_help_phpbb_stats_after --> + <fieldset> + <p class="submit-buttons"> + <input type="hidden" name="systemdata" value="{RAW_DATA}" /> + <input type="hidden" name="help_send_statistics_time" value="{COLLECT_STATS_TIME}" /> + <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> + </p> + {S_FORM_TOKEN} + </fieldset> +</div> +</form> +<form action="{U_COLLECT_STATS}" method="post" target="questionaire_result" id="questionnaire-form"> + <fieldset> + <p class="submit-buttons"> + <input type="hidden" name="systemdata" value="{RAW_DATA}" /> + <input class="button1" type="submit" id="submit_stats" name="submit" value="{L_SEND_STATISTICS}" /> + </p> + </fieldset> +</form> + +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index efcb25cb68..1bdb7b8d2a 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -30,6 +30,11 @@ <p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> · <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p> </div> <!-- ENDIF --> + <!-- IF S_VERSION_UPGRADEABLE --> + <div class="errorbox notice"> + <p>{UPGRADE_INSTRUCTIONS}</p> + </div> + <!-- ENDIF --> <!-- IF S_SEARCH_INDEX_MISSING --> <div class="errorbox"> diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 07718846cc..cebd2e9632 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -127,6 +127,7 @@ <!-- ENDIF --> </dl> <!-- ENDIF --> + <!-- EVENT acp_profile_step_one_lang_after --> </fieldset> <fieldset class="quick"> diff --git a/phpBB/adm/style/acp_send_statistics.html b/phpBB/adm/style/acp_send_statistics.html deleted file mode 100644 index 480e438e1f..0000000000 --- a/phpBB/adm/style/acp_send_statistics.html +++ /dev/null @@ -1,64 +0,0 @@ -<!-- INCLUDE overall_header.html --> - -<a id="maincontent"></a> - -<h1>{L_SEND_STATISTICS}</h1> - -<p>{L_EXPLAIN_SEND_STATISTICS}</p> - -<script type="text/javascript"> -//<![CDATA[ -var iframect = 0; - -function iframe_updated() -{ - if (iframect++ == 0) - { - return; - } - - phpbb.toggleDisplay('questionnaire-form', -1); - phpbb.toggleDisplay('questionnaire-thanks', 1); -} -//]]> -</script> - -<iframe onload="iframe_updated();" name="questionaire_result" style="display: none;"></iframe> - -<form action="{U_COLLECT_STATS}" method="post" target="questionaire_result" id="questionnaire-form"> - - <p><a href="{U_ACP_MAIN}">{L_DONT_SEND_STATISTICS}</a></p> - - <p>{L_EXPLAIN_SHOW_STATISTICS}</p> - - <p id="show-button"><input type="button" class="button2" onclick="phpbb.toggleDisplay('configlist', 1); phpbb.toggleDisplay('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p> - - <div id="configlist"> - <input type="button" class="button2" onclick="phpbb.toggleDisplay('show-button', 1); phpbb.toggleDisplay('configlist', -1);" value="{L_HIDE_STATISTICS}" /> - <p class="submit-buttons"> - <input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" /> - </p> - - <!-- BEGIN providers --> - <fieldset> - <legend>{providers.NAME}</legend> - <!-- BEGIN values --> - <dl> - <dt>{providers.values.KEY}</dt> - <dd>{providers.values.VALUE}</dd> - </dl> - <!-- END values --> - </fieldset> - <!-- END providers --> - </div> - <p class="submit-buttons"> - <input type="hidden" name="systemdata" value="{RAW_DATA}" /> - <input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" /> - </p> -</form> - -<div id="questionnaire-thanks" class="successbox"> - <p><strong>{L_THANKS_SEND_STATISTICS}</strong><br /><br /><a href="{U_ACP_MAIN}">« {L_GO_ACP_MAIN}</a></p> -</div> - -<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index a36d15fe73..43c2f96a65 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -52,6 +52,10 @@ <dd><strong>{STYLE_PATH}</strong></dd> </dl> <dl> + <dt><label>{L_STYLE_VERSION}{L_COLON}</label></dt> + <dd><strong>{STYLE_VERSION}</strong></dd> + </dl> + <dl> <dt><label for="name">{L_COPYRIGHT}{L_COLON}</label></dt> <dd><strong>{STYLE_COPYRIGHT}</strong></dd> </dl> diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html index 351a3ba26c..5288833d05 100644 --- a/phpBB/adm/style/acp_update.html +++ b/phpBB/adm/style/acp_update.html @@ -20,6 +20,11 @@ <p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p> </div> <!-- ENDIF --> +<!-- IF S_VERSION_UPGRADEABLE --> + <div class="errorbox notice"> + <p>{UPGRADE_INSTRUCTIONS}</p> + </div> +<!-- ENDIF --> <fieldset> <legend></legend> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index e1668bf70b..2322b3da88 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1,4 +1,4 @@ -/* phpBB 3.1 Admin Style Sheet +/* phpBB 3.2 Admin Style Sheet ------------------------------------------------------------------------ Original author: subBlue ( http://www.subblue.com/ ) Copyright (c) phpBB Limited <https://www.phpbb.com> @@ -2583,3 +2583,120 @@ fieldset.permissions .padding { line-height: 25px; font-weight: bold; } + +.send-stats-row { + margin: 15px 0; +} + +.send-stats-row:before { + display: table; + content: " "; +} + +.send-stats-tile { + position: relative; + padding: 14px; + margin-bottom: 20px; + background-color: #eff0f2; + border-radius: 6px; + box-shadow: rgba(0,0,0,0.3) 1px 1px 5px; +} + +.send-stats-tile h2 { + margin-top: 0; + text-align: center; + padding-bottom: 1em; +} + +.send-stats-tile i { + padding-right: 0.3em; +} + +.icon { + font-family: FontAwesome; + font-style: normal; +} + +.send-stats-data-row { + background: #f9f9f9; + border-radius: 6px; + border: #DEDEDE 1px solid; + padding: 10px; + border-top-width: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} + +.send-stats-data-hidden .configlist { + display: none; +} + +.send-stats-data-only-row { + border-radius: 6px !important; + border-bottom-width: 1px !important; +} + +.send-stats-data-hidden { + padding: 0; + border: none; +} + +.send-stats-row > .send-stats-data-row:first-child { + background-color: #d9edf7; + border-bottom-width: 0; + border-top-right-radius: 6px; + border-top-left-radius: 6px; + border-top-width: 1px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +.send-stats-settings dt, .send-stats-settings dd { + min-width: 25px; +} + +.send-stats-settings dd { + line-height: 1.5em; +} + +.send-stats-settings input { + display: none; +} + +.send-stats-settings input[type=checkbox] + label:before { + content: "\f096"; + font-family: FontAwesome; + font-size: 1.5em; +} + +.send-stats-settings input[type=checkbox]:checked + label:before { + content: "\f14a"; + color: #3c763d; +} + +.send-stats-data-row a:hover span { + text-decoration: underline; +} + +.send-stats-data-row a { + text-decoration: none; + cursor: default; +} + +.send-stats-data-row i { + padding-left: 6px; +} + +.configlist { + word-wrap: break-word; + word-break: break-all; +} + +/* stylelint-disable declaration-property-unit-whitelist */ +.emoji { + min-height: 18px; + min-width: 18px; + height: 1em; + width: 1em; +} +/* stylelint-enable declaration-property-unit-whitelist */ diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js index 253fd46a62..551c78a4a3 100644 --- a/phpBB/adm/style/admin.js +++ b/phpBB/adm/style/admin.js @@ -243,8 +243,16 @@ function parse_document(container) parse_document($('body')); - // Hide configlist and success message in send statistics page - phpbb.toggleDisplay('configlist', -1); - phpbb.toggleDisplay('questionnaire-thanks', -1); + $('#questionnaire-form').css('display', 'none'); + var $triggerConfiglist = $('#trigger-configlist'); + + $triggerConfiglist.on('click', function () { + var $configlist = $('#configlist'); + $configlist.closest('.send-stats-data-row').toggleClass('send-stats-data-hidden'); + $configlist.closest('.send-stats-row').find('.send-stats-data-row:first-child').toggleClass('send-stats-data-only-row'); + $(this).find('i').toggleClass('fa-angle-down fa-angle-up'); + }); + + $('#configlist').closest('.send-stats-data-row').addClass('send-stats-data-hidden'); }); })(jQuery); diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 4ad6b6afa5..895bb056e5 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -4,6 +4,101 @@ 'use strict'; + +phpbb.prepareSendStats = function () { + var $form = $('#acp_help_phpbb'); + var $dark = $('#darkenwrapper'); + var $loadingIndicator; + + $form.on('submit', function (event) { + var $this = $(this), + currentTime = Math.floor(new Date().getTime() / 1000), + statsTime = parseInt($this.find('input[name=help_send_statistics_time]').val(), 10); + + event.preventDefault(); + $this.unbind('submit'); + + // Skip ajax request if form is submitted too early or send stats + // checkbox is not checked + if (!$this.find('input[name=help_send_statistics]').is(':checked') || + statsTime > currentTime) { + $form.find('input[type=submit]').click(); + setTimeout(function () { + $form.find('input[type=submit]').click(); + }, 300); + return; + } + + /** + * Handler for AJAX errors + */ + function errorHandler(jqXHR, textStatus, errorThrown) { + if (typeof console !== 'undefined' && console.log) { + console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown); + } + phpbb.clearLoadingTimeout(); + var errorText = ''; + + if (typeof errorThrown === 'string' && errorThrown.length > 0) { + errorText = errorThrown; + } else { + errorText = $dark.attr('data-ajax-error-text-' + textStatus); + if (typeof errorText !== 'string' || !errorText.length) { + errorText = $dark.attr('data-ajax-error-text'); + } + } + phpbb.alert($dark.attr('data-ajax-error-title'), errorText); + } + + /** + * This is a private function used to handle the callbacks, refreshes + * and alert. It calls the callback, refreshes the page if necessary, and + * displays an alert to the user and removes it after an amount of time. + * + * It cannot be called from outside this function, and is purely here to + * avoid repetition of code. + * + * @param {object} res The object sent back by the server. + */ + function returnHandler(res) { + phpbb.clearLoadingTimeout(); + + // If a confirmation is not required, display an alert and call the + // callbacks. + $dark.fadeOut(phpbb.alertTime); + + if ($loadingIndicator) { + $loadingIndicator.fadeOut(phpbb.alertTime); + } + + var $sendStatisticsSuccess = $('<input />', { + type: 'hidden', + name: 'send_statistics_response', + value: res + }); + $sendStatisticsSuccess.appendTo('p.submit-buttons'); + + // Finish actual form submission + $form.find('input[type=submit]').click(); + } + + $loadingIndicator = phpbb.loadingIndicator(); + + $.ajax({ + url: $this.attr('data-ajax-action').replace('&', '&'), + type: 'POST', + data: 'systemdata=' + encodeURIComponent($this.find('input[name=systemdata]').val()), + success: returnHandler, + error: errorHandler, + cache: false + }).always(function() { + if ($loadingIndicator && $loadingIndicator.is(':visible')) { + $loadingIndicator.fadeOut(phpbb.alertTime); + } + }); + }); +}; + /** * The following callbacks are for reording items. row_down * is triggered when an item is moved down, and row_up is triggered when @@ -62,7 +157,139 @@ phpbb.addAjaxCallback('row_delete', function(res) { } }); +/** + * Handler for submitting permissions form in chunks + * This call will submit permissions forms in chunks of 5 fieldsets. + */ +function submitPermissions() { + var $form = $('form#set-permissions'), + fieldsetList = $form.find('fieldset[id^=perm]'), + formDataSets = [], + dataSetIndex = 0, + $submitAllButton = $form.find('input[type=submit][name^=action]')[0], + $submitButton = $form.find('input[type=submit][data-clicked=true]')[0]; + + // Set proper start values for handling refresh of page + var permissionSubmitSize = 0, + permissionRequestCount = 0, + forumIds = [], + permissionSubmitFailed = false; + + if ($submitAllButton !== $submitButton) { + fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id); + } + + $.each(fieldsetList, function (key, value) { + dataSetIndex = Math.floor(key / 5); + var $fieldset = $('fieldset#' + value.id); + if (key % 5 === 0) { + formDataSets[dataSetIndex] = $fieldset.find('select:visible, input:not([data-name])').serialize(); + } else { + formDataSets[dataSetIndex] += '&' + $fieldset.find('select:visible, input:not([data-name])').serialize(); + } + + // Find proper role value + var roleInput = $fieldset.find('input[name^=role][data-name]'); + if (roleInput.val()) { + formDataSets[dataSetIndex] += '&' + roleInput.attr('name') + '=' + roleInput.val(); + } else { + formDataSets[dataSetIndex] += '&' + roleInput.attr('name') + '=' + + $fieldset.find('select[name="' + roleInput.attr('name') + '"]').val(); + } + }); + + permissionSubmitSize = formDataSets.length; + + // Add each forum ID to forum ID list to preserve selected forums + $.each($form.find('input[type=hidden][name^=forum_id]'), function (key, value) { + if (value.name.match(/^forum_id\[([0-9]+)\]$/)) { + forumIds.push(value.value); + } + }); + + /** + * Handler for submitted permissions form chunk + * + * @param {object} res Object returned by AJAX call + */ + function handlePermissionReturn(res) { + permissionRequestCount++; + var $dark = $('#darkenwrapper'); + + if (res.S_USER_WARNING) { + phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); + permissionSubmitFailed = true; + } else if (!permissionSubmitFailed && res.S_USER_NOTICE) { + // Display success message at the end of submitting the form + if (permissionRequestCount >= permissionSubmitSize) { + var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); + var $alertBoxLink = $alert.find('p.alert_text > a'); + + // Create form to submit instead of normal "Back to previous page" link + if ($alertBoxLink) { + // Remove forum_id[] from URL + $alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/g, '')); + var previousPageForm = '<form action="' + $alertBoxLink.attr('href') + '" method="post">'; + $.each(forumIds, function (key, value) { + previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />'; + }); + previousPageForm += '</form>'; + + $alertBoxLink.on('click', function (e) { + var $previousPageForm = $(previousPageForm); + $('body').append($previousPageForm); + e.preventDefault(); + $previousPageForm.submit(); + }); + } + + // Do not allow closing alert + $dark.off('click'); + $alert.find('.alert_close').hide(); + + if (typeof res.REFRESH_DATA !== 'undefined') { + setTimeout(function () { + // Create forum to submit using POST. This will prevent + // exceeding the maximum length of URLs + var form = '<form action="' + res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, '') + '" method="post">'; + $.each(forumIds, function (key, value) { + form += '<input type="text" name="forum_id[]" value="' + value + '" />'; + }); + form += '</form>'; + $form = $(form); + $('body').append($form); + // Hide the alert even if we refresh the page, in case the user + // presses the back button. + $dark.fadeOut(phpbb.alertTime, function () { + if (typeof $alert !== 'undefined') { + $alert.hide(); + } + }); + + // Submit form + $form.submit(); + }, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds + } + } + } + } + + // Create AJAX request for each form data set + $.each(formDataSets, function (key, formData) { + $.ajax({ + url: $form.action, + type: 'POST', + data: formData + '&' + $submitButton.name + '=' + encodeURIComponent($submitButton.value) + + '&creation_time=' + $form.find('input[type=hidden][name=creation_time]')[0].value + + '&form_token=' + $form.find('input[type=hidden][name=form_token]')[0].value + + '&' + $form.children('input[type=hidden]').serialize() + + '&' + $form.find('input[type=checkbox][name^=inherit]').serialize(), + success: handlePermissionReturn, + error: handlePermissionReturn + }); + }); +} $('[data-ajax]').each(function() { var $this = $(this), @@ -83,6 +310,22 @@ $('[data-ajax]').each(function() { */ $(function() { phpbb.resizeTextArea($('textarea:not(.no-auto-resize)'), {minHeight: 75}); + + var $setPermissionsForm = $('form#set-permissions'); + if ($setPermissionsForm.length) { + $setPermissionsForm.on('submit', function (e) { + submitPermissions(); + e.preventDefault(); + }); + $setPermissionsForm.find('input[type=submit]').click(function() { + $('input[type=submit]', $(this).parents($('form#set-permissions'))).removeAttr('data-clicked'); + $(this).attr('data-clicked', true); + }); + } + + if ($('#acp_help_phpbb')) { + phpbb.prepareSendStats(); + } }); diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index f227f729fd..8279ac34dc 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -7,6 +7,7 @@ <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> +<link href="{T_FONT_AWESOME_LINK}" rel="stylesheet"> <link href="style/admin.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript"> @@ -53,7 +54,7 @@ function marklist(id, name, state) for (var r = 0; r < rb.length; r++) { - if (rb[r].name.substr(0, name.length) == name) + if (rb[r].name.substr(0, name.length) == name && rb[r].disabled !== true) { rb[r].checked = state; } diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 9f47b2052b..439645a211 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -66,7 +66,7 @@ function marklist(id, name, state) for (var r = 0; r < rb.length; r++) { - if (rb[r].name.substr(0, name.length) == name) + if (rb[r].name.substr(0, name.length) == name && rb[r].disabled !== true) { rb[r].checked = state; } diff --git a/phpBB/adm/style/tooltip.js b/phpBB/adm/style/tooltip.js index 65773ae14f..8781e2b509 100644 --- a/phpBB/adm/style/tooltip.js +++ b/phpBB/adm/style/tooltip.js @@ -211,6 +211,23 @@ $(function() { // Prepare dropdown phpbb.prepareRolesDropdown(); + + // Reset role drop-down on modifying permissions in advanced tab + $('div.permissions-switch > a').on('click', function () { + $.each($('input[type=radio][name^="setting["]'), function () { + var $this = $(this); + $this.on('click', function () { + var $rolesOptions = $this.closest('fieldset.permissions').find('.roles-options'), + rolesSelect = $rolesOptions.find('select > option')[0]; + + // Set selected setting + $rolesOptions.children('span') + .text(rolesSelect.text); + $rolesOptions.children('input[type=hidden]') + .val(rolesSelect.value); + }); + }); + }); }); })(jQuery); // Avoid conflicts with other libraries |