From 3e6fd7e8fd419ed999fe38ee48519dae98988081 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 14 May 2018 21:14:41 +0200 Subject: [ticket/15664] Ajaxify ext actions in ACP PHPBB3-15664 --- phpBB/adm/style/ajax.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'phpBB/adm/style/ajax.js') diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 895bb056e5..644e74bef7 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -157,6 +157,34 @@ phpbb.addAjaxCallback('row_delete', function(res) { } }); +/** + * Callbacks for extension actions + */ +phpbb.addAjaxCallback('ext_enable', function(res) { + if (res.EXT_ENABLE_SUCCESS) { + move_to_enabled(this.parentNode.parentNode); + set_actions(this.parentNode, res.ACTIONS); + show_enabled_header(); + hide_disabled_header_if_empty(); + } +}); +phpbb.addAjaxCallback('ext_delete_data', function(res) { + if (res.EXT_DELETE_DATA_SUCCESS) { + move_to_disabled(this.parentNode.parentNode); + set_actions(this.parentNode, res.ACTIONS); + show_disabled_header(); + hide_enabled_header_if_empty(); + } +}); +phpbb.addAjaxCallback('ext_disable', function(res) { + if (res.EXT_DISABLE_SUCCESS) { + move_to_disabled(this.parentNode.parentNode); + set_actions(this.parentNode, res.ACTIONS); + show_disabled_header(); + hide_enabled_header_if_empty(); + } +}); + /** * Handler for submitting permissions form in chunks * This call will submit permissions forms in chunks of 5 fieldsets. -- cgit v1.2.1 From f866a8fd1bac7da74c88763447ad2f3ff1b9a10c Mon Sep 17 00:00:00 2001 From: paul sohier Date: Thu, 2 Jan 2020 15:21:34 +0100 Subject: [ticket/16287] After installation an error is given over statistics submission The phpBB.com website required specific fields to be available for the statistics. This change switched over to a new statistics page on www.phpbb.com that uses form fields instead, and that returns JSON as value. PHPBB3-16287 --- phpBB/adm/style/ajax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/adm/style/ajax.js') diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 644e74bef7..b9424723bb 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -1,4 +1,4 @@ -/* global phpbb */ +/* global phpbb, statsData */ (function($) { // Avoid conflicts with other libraries @@ -87,7 +87,7 @@ phpbb.prepareSendStats = function () { $.ajax({ url: $this.attr('data-ajax-action').replace('&', '&'), type: 'POST', - data: 'systemdata=' + encodeURIComponent($this.find('input[name=systemdata]').val()), + data: statsData, success: returnHandler, error: errorHandler, cache: false -- cgit v1.2.1 From a0ffbfce315ce45df4085d4c83536f2024e71a3f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 3 Jan 2020 10:17:40 +0100 Subject: [ticket/16287] Correctly pass json response to PHP file PHPBB3-16287 --- phpBB/adm/style/ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/adm/style/ajax.js') diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index b9424723bb..39b63e4696 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -74,7 +74,7 @@ phpbb.prepareSendStats = function () { var $sendStatisticsSuccess = $('', { type: 'hidden', name: 'send_statistics_response', - value: res + value: JSON.stringify(res) }); $sendStatisticsSuccess.appendTo('p.submit-buttons'); -- cgit v1.2.1