From 66436bd9f7bf819e3efc6cdd65d5502e6afaeb90 Mon Sep 17 00:00:00 2001 From: kasimi Date: Sat, 18 Apr 2020 00:43:47 +0200 Subject: [PATCH 1/8] [ticket/16449] Remove AJAX actions for extension management This reverts commits 2b66608023a2a4f4212984dc350cb5d67e3b4b97 5cf88ea871afa9444f808bb9a2bb0e2b8e54056c PHPBB3-16449 --- phpBB/adm/style/acp_ext_actions.html | 7 - phpBB/adm/style/acp_ext_delete_data.html | 40 ++++++ phpBB/adm/style/acp_ext_disable.html | 34 +++++ phpBB/adm/style/acp_ext_enable.html | 40 ++++++ phpBB/adm/style/acp_ext_list.html | 19 ++- phpBB/adm/style/admin.js | 58 -------- phpBB/adm/style/ajax.js | 28 ---- phpBB/includes/acp/acp_extensions.php | 164 ++++++----------------- phpBB/language/en/migrator.php | 2 +- tests/functional/extension_acp_test.php | 8 +- 10 files changed, 172 insertions(+), 228 deletions(-) delete mode 100644 phpBB/adm/style/acp_ext_actions.html create mode 100644 phpBB/adm/style/acp_ext_delete_data.html create mode 100644 phpBB/adm/style/acp_ext_disable.html create mode 100644 phpBB/adm/style/acp_ext_enable.html diff --git a/phpBB/adm/style/acp_ext_actions.html b/phpBB/adm/style/acp_ext_actions.html deleted file mode 100644 index 6b59ab7180..0000000000 --- a/phpBB/adm/style/acp_ext_actions.html +++ /dev/null @@ -1,7 +0,0 @@ -{% for action in enabled.actions %} - {{ action.L_ACTION }}{% if not action.S_LAST_ROW %} | {% endif %} -{% endfor %} - -{% for action in disabled.actions %} - {{ action.L_ACTION }}{% if not action.S_LAST_ROW %} | {% endif %} -{% endfor %} diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html new file mode 100644 index 0000000000..0f3adb7cfe --- /dev/null +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -0,0 +1,40 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+

{L_EXTENSION_DELETE_DATA_EXPLAIN}

+ + +
+

{L_MIGRATION_EXCEPTION_ERROR}

+

{MIGRATOR_ERROR}

+

{L_RETURN_TO_EXTENSION_LIST}

+
+ +
+

{L_CONFIRM_MESSAGE}

+
+ +
+
+ {L_EXTENSION_DELETE_DATA} + + +
+
+ +
+

{L_EXTENSION_DELETE_DATA_IN_PROGRESS}

+
+ +
+

{L_EXTENSION_DELETE_DATA_SUCCESS}

+
+

{L_RETURN_TO_EXTENSION_LIST}

+
+ + + diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html new file mode 100644 index 0000000000..d2b5c46fe8 --- /dev/null +++ b/phpBB/adm/style/acp_ext_disable.html @@ -0,0 +1,34 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+

{L_EXTENSION_DISABLE_EXPLAIN}

+ + +
+

{L_CONFIRM}

+

{L_CONFIRM_MESSAGE}

+
+ +
+
+ + +
+
+ +
+

{L_EXTENSION_DISABLE_IN_PROGRESS}

+
+ +
+

{L_EXTENSION_DISABLE_SUCCESS}

+
+

{L_RETURN_TO_EXTENSION_LIST}

+
+ + + diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html new file mode 100644 index 0000000000..8a4a35359e --- /dev/null +++ b/phpBB/adm/style/acp_ext_enable.html @@ -0,0 +1,40 @@ + + + + +

{L_EXTENSIONS_ADMIN}

+ +

{L_EXTENSIONS_EXPLAIN}

+

{L_EXTENSION_ENABLE_EXPLAIN}

+ + +
+

{L_MIGRATION_EXCEPTION_ERROR}

+

{MIGRATOR_ERROR}

+

{L_RETURN_TO_EXTENSION_LIST}

+
+ +
+

{L_CONFIRM}

+

{L_CONFIRM_MESSAGE}

+
+ +
+
+ + +
+
+ +
+

{L_EXTENSION_ENABLE_IN_PROGRESS}

+
+ +
+

{L_EXTENSION_ENABLE_SUCCESS}

+
+

{L_RETURN_TO_EXTENSION_LIST}

+
+ + + diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index e5783124c6..9e019fa1c2 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -42,8 +42,8 @@ - - class="hidden"> + + {L_EXTENSIONS_ENABLED} @@ -59,12 +59,17 @@ {L_DETAILS} - + + title="{enabled.actions.L_ACTION_EXPLAIN}">{enabled.actions.L_ACTION} +  |  + + - class="hidden"> + + {L_EXTENSIONS_DISABLED} @@ -82,10 +87,14 @@ {L_DETAILS} - + + title="{disabled.actions.L_ACTION_EXPLAIN}">{disabled.actions.L_ACTION} +  |  + + diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js index 5fdd07356c..551c78a4a3 100644 --- a/phpBB/adm/style/admin.js +++ b/phpBB/adm/style/admin.js @@ -228,64 +228,6 @@ function parse_document(container) }); } -/** - * Extension actions helper functions - */ -function move_to_enabled(element) -{ - var disabled_header = document.querySelector('#ext_disabled_header'); - disabled_header.parentNode.insertBefore(element, disabled_header); - element.classList.remove('ext_disabled'); - element.classList.add('ext_enabled'); -} -function move_to_disabled(element) -{ - var table_body = document.querySelector('#ext_disabled_header').parentNode; - table_body.appendChild(element); - element.classList.remove('ext_enabled'); - element.classList.add('ext_disabled'); -} -function set_actions(container, actions) { - container.innerHTML = ''; - for (var i = 0; i < actions.length; i++) { - var a = document.createElement('a'); - a.href = actions[i].U_ACTION.split('&').join('&'); // replace all occurances - a.title = actions[i].L_ACTION_EXPLAIN; - if (actions[i].COLOR) { - a.style = actions[i].COLOR; - } - a.innerHTML = actions[i].L_ACTION; - // ajaxify this action as well - phpbb.ajaxify({ - selector: a, - refresh: true, - callback: actions[i].ACTION_AJAX - }); - - container.appendChild(a); - - if (i < actions.length - 1) { - container.innerHTML += ' | '; - } - } -} -function show_enabled_header() { - document.querySelector('#ext_enabled_header').classList.remove('hidden'); -} -function show_disabled_header() { - document.querySelector('#ext_disabled_header').classList.remove('hidden'); -} -function hide_disabled_header_if_empty() { - if (!document.querySelector('.ext_disabled')) { - document.querySelector('#ext_disabled_header').classList.add('hidden'); - } -} -function hide_enabled_header_if_empty() { - if (!document.querySelector('.ext_enabled')) { - document.querySelector('#ext_enabled_header').classList.add('hidden'); - } -} - /** * Run onload functions */ diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 3702c94ca8..d1007d0173 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -157,34 +157,6 @@ 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. diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 86966541be..98db47886a 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -180,19 +180,13 @@ class acp_extensions redirect($this->u_action); } - if (confirm_box(true)) - { - redirect($this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name)); - } - else - { - confirm_box(false, $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array( - 'i' => $id, - 'mode' => $mode, - 'action' => 'enable_pre', - 'ext_name' => $ext_name, - ))); - } + $this->tpl_name = 'acp_ext_enable'; + + $this->template->assign_vars(array( + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), + )); break; case 'enable': @@ -217,8 +211,9 @@ class acp_extensions // Are we approaching the time limit? If so we want to pause the update and continue after refreshing if ((time() - $start_time) >= $safe_time_limit) { + $this->template->assign_var('S_NEXT_STEP', true); + meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name)); - trigger_error('EXTENSION_ENABLE_IN_PROGRESS', E_USER_NOTICE); } } @@ -234,29 +229,14 @@ class acp_extensions } catch (\phpbb\db\migration\exception $e) { - trigger_error($this->user->lang('MIGRATION_EXCEPTION_ERROR', $e->getLocalisedMessage($this->user)), E_USER_WARNING); + $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user)); } - if ($this->request->is_ajax()) - { - $actions = $this->output_actions('enabled', [ - 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($ext_name), - ]); + $this->tpl_name = 'acp_ext_enable'; - $data = [ - 'EXT_ENABLE_SUCCESS' => true, - 'ACTIONS' => $actions, - 'REFRESH_DATA' => [ - 'url' => '', - 'time' => 0, - ], - ]; - - $json_response = new \phpbb\json_response; - $json_response->send($data); - } - - trigger_error($this->user->lang('EXTENSION_ENABLE_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE); + $this->template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); break; case 'disable_pre': @@ -265,19 +245,13 @@ class acp_extensions redirect($this->u_action); } - if (confirm_box(true)) - { - redirect($this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name)); - } - else - { - confirm_box(false, $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array( - 'i' => $id, - 'mode' => $mode, - 'action' => 'disable_pre', - 'ext_name' => $ext_name, - ))); - } + $this->tpl_name = 'acp_ext_disable'; + + $this->template->assign_vars(array( + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), + )); break; case 'disable': @@ -294,32 +268,15 @@ class acp_extensions $this->template->assign_var('S_NEXT_STEP', true); meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name)); - trigger_error('EXTENSION_DISABLE_IN_PROGRESS', E_USER_NOTICE); } } $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name)); - if ($this->request->is_ajax()) - { - $actions = $this->output_actions('disabled', [ - 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($ext_name), - 'DELETE_DATA' => $this->u_action . '&action=delete_data_pre&ext_name=' . urlencode($ext_name), - ]); + $this->tpl_name = 'acp_ext_disable'; - $data = [ - 'EXT_DISABLE_SUCCESS' => true, - 'ACTIONS' => $actions, - 'REFRESH_DATA' => [ - 'url' => '', - 'time' => 0, - ], - ]; - - $json_response = new \phpbb\json_response; - $json_response->send($data); - } - - trigger_error($this->user->lang('EXTENSION_DISABLE_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE); + $this->template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); break; case 'delete_data_pre': @@ -327,20 +284,13 @@ class acp_extensions { redirect($this->u_action); } + $this->tpl_name = 'acp_ext_delete_data'; - if (confirm_box(true)) - { - redirect($this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name)); - } - else - { - confirm_box(false, $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array( - 'i' => $id, - 'mode' => $mode, - 'action' => 'delete_data_pre', - 'ext_name' => $ext_name, - ))); - } + $this->template->assign_vars(array( + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), + )); break; case 'delete_data': @@ -359,36 +309,20 @@ class acp_extensions $this->template->assign_var('S_NEXT_STEP', true); meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name)); - trigger_error('EXTENSION_DELETE_DATA_IN_PROGRESS', E_USER_NOTICE); } } $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_PURGE', time(), array($ext_name)); } catch (\phpbb\db\migration\exception $e) { - trigger_error($this->user->lang('MIGRATION_EXCEPTION_ERROR', $e->getLocalisedMessage($this->user)), E_USER_WARNING); + $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user)); } - if ($this->request->is_ajax()) - { - $actions = $this->output_actions('disabled', [ - 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($ext_name), - ]); + $this->tpl_name = 'acp_ext_delete_data'; - $data = [ - 'EXT_DELETE_DATA_SUCCESS' => true, - 'ACTIONS' => $actions, - 'REFRESH_DATA' => [ - 'url' => '', - 'time' => 0, - ], - ]; - - $json_response = new \phpbb\json_response; - $json_response->send($data); - } - - trigger_error($this->user->lang('EXTENSION_DELETE_DATA_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE); + $this->template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); break; case 'details': @@ -667,37 +601,17 @@ class acp_extensions * * @param string $block * @param array $actions - * @return array List of actions to be performed on the extension */ private function output_actions($block, $actions) { - $vars_ary = array(); - foreach ($actions as $lang => $options) + foreach ($actions as $lang => $url) { - $url = $options; - if (is_array($options)) - { - $url = $options['url']; - } - - $vars = array( + $this->template->assign_block_vars($block . '.actions', array( 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang), 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '', 'U_ACTION' => $url, - 'ACTION_AJAX' => 'ext_' . strtolower($lang), - ); - - if (isset($options['color'])) - { - $vars['COLOR'] = $options['color']; - } - - $this->template->assign_block_vars($block . '.actions', $vars); - - $vars_ary[] = $vars; + )); } - - return $vars_ary; } /** diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php index 03802549d2..8a82d40be5 100644 --- a/phpBB/language/en/migrator.php +++ b/phpBB/language/en/migrator.php @@ -46,7 +46,7 @@ $lang = array_merge($lang, array( 'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds', 'MIGRATION_DATA_RUNNING' => 'Installing Data: %s.', 'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s', - 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors:

%s', + 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.', 'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".', 'MIGRATION_NOT_INSTALLED' => 'The migration "%s" is not installed.', 'MIGRATION_NOT_VALID' => '%s is not a valid migration.', diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 9a326dba68..33a9b443bb 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -200,7 +200,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('#main')->text()); + $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text()); } public function test_actions() @@ -211,7 +211,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Correctly submit the enable form $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton('enable')->form(); $crawler = self::submit($form); $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('.successbox')->text()); @@ -221,7 +221,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Correctly submit the disable form $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton('disable')->form(); $crawler = self::submit($form); $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('.successbox')->text()); @@ -231,7 +231,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Correctly submit the delete data form $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton('delete_data')->form(); $crawler = self::submit($form); $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('.successbox')->text()); From f4b9a7143cac8551cf32dc967c2eae6fee62371d Mon Sep 17 00:00:00 2001 From: kasimi Date: Sat, 18 Apr 2020 01:24:39 +0200 Subject: [PATCH 2/8] [ticket/16449] Fixed tests PHPBB3-16449 --- .../phpbb_functional_test_case.php | 21 +++++++++++-------- tests/test_framework/phpbb_ui_test_case.php | 21 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 19062aa148..94a7d4e7af 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -418,17 +418,18 @@ class phpbb_functional_test_case extends phpbb_test_case public function install_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count()); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton($this->lang('EXTENSION_ENABLE'))->form(); $crawler = self::submit($form); - $this->add_lang('acp/extensions'); $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); @@ -448,17 +449,18 @@ class phpbb_functional_test_case extends phpbb_test_case public function disable_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count()); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton($this->lang('EXTENSION_DISABLE'))->form(); $crawler = self::submit($form); - $this->add_lang('acp/extensions'); $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); @@ -478,17 +480,18 @@ class phpbb_functional_test_case extends phpbb_test_case public function delete_ext_data($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count()); - $form = $crawler->selectButton('confirm')->form(); + $form = $crawler->selectButton($this->lang('EXTENSION_DELETE_DATA'))->form(); $crawler = self::submit($form); - $this->add_lang('acp/extensions'); $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index 243db39d69..f593e13b18 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -333,16 +333,17 @@ class phpbb_ui_test_case extends phpbb_test_case public function install_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2'))); - $this->find_element('cssSelector', "input[value='Yes']")->submit(); - $this->add_lang('acp/extensions'); + $this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_ENABLE') . "']")->submit(); try { @@ -368,16 +369,17 @@ class phpbb_ui_test_case extends phpbb_test_case public function disable_ext($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2'))); - $this->find_element('cssSelector', "input[value='Yes']")->submit(); - $this->add_lang('acp/extensions'); + $this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_DISABLE') . "']")->submit(); try { @@ -403,16 +405,17 @@ class phpbb_ui_test_case extends phpbb_test_case public function delete_ext_data($extension) { + $this->add_lang('acp/extensions'); + $this->login(); $this->admin_login(); $ext_path = str_replace('/', '%2F', $extension); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2'))); - $this->find_element('cssSelector', "input[value='Yes']")->submit(); - $this->add_lang('acp/extensions'); + $this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_DELETE_DATA') . "']")->submit(); try { From 7d1aa37f50c3de3e39ed68d40dca18e4ed76aa36 Mon Sep 17 00:00:00 2001 From: kasimi Date: Thu, 23 Apr 2020 10:24:50 +0200 Subject: [PATCH 3/8] [ticket/16449] Use Twig syntax PHPBB3-16449 --- phpBB/adm/style/acp_ext_delete_data.html | 42 ++++++++++++------------ phpBB/adm/style/acp_ext_disable.html | 34 +++++++++---------- phpBB/adm/style/acp_ext_enable.html | 42 ++++++++++++------------ 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html index 0f3adb7cfe..a07b723e90 100644 --- a/phpBB/adm/style/acp_ext_delete_data.html +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -1,40 +1,40 @@ - +{% INCLUDE 'overall_header.html' %} -

{L_EXTENSIONS_ADMIN}

+

{{ lang('EXTENSIONS_ADMIN') }}

-

{L_EXTENSIONS_EXPLAIN}

-

{L_EXTENSION_DELETE_DATA_EXPLAIN}

+

{{ lang('EXTENSIONS_EXPLAIN') }}

+

{{ lang('EXTENSION_DELETE_DATA_EXPLAIN') }}

- + {% if MIGRATOR_ERROR %}
-

{L_MIGRATION_EXCEPTION_ERROR}

-

{MIGRATOR_ERROR}

-

{L_RETURN_TO_EXTENSION_LIST}

+

{{ lang('MIGRATION_EXCEPTION_ERROR') }}

+

{{ MIGRATOR_ERROR }}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- + {% elseif PRE %}
-

{L_CONFIRM_MESSAGE}

+

{{ lang('CONFIRM_MESSAGE') }}

-
+
- {L_EXTENSION_DELETE_DATA} - - + {{ lang('EXTENSION_DELETE_DATA') }} + +
- + {% elseif S_NEXT_STEP %}
-

{L_EXTENSION_DELETE_DATA_IN_PROGRESS}

+

{{ lang('EXTENSION_DELETE_DATA_IN_PROGRESS') }}

- + {% else %}
-

{L_EXTENSION_DELETE_DATA_SUCCESS}

+

{{ lang('EXTENSION_DELETE_DATA_SUCCESS') }}


-

{L_RETURN_TO_EXTENSION_LIST}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- + {% endif %} - +{% INCLUDE 'overall_footer.html' %} diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index d2b5c46fe8..3285b7f46d 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -1,34 +1,34 @@ - +{% INCLUDE 'overall_header.html' %} -

{L_EXTENSIONS_ADMIN}

+

{{ lang('EXTENSIONS_ADMIN') }}

-

{L_EXTENSIONS_EXPLAIN}

-

{L_EXTENSION_DISABLE_EXPLAIN}

+

{{ lang('EXTENSIONS_EXPLAIN') }}

+

{{ lang('EXTENSION_DISABLE_EXPLAIN') }}

- + {% if PRE %}
-

{L_CONFIRM}

-

{L_CONFIRM_MESSAGE}

+

{{ lang('CONFIRM') }}

+

{{ lang('CONFIRM_MESSAGE') }}

-
+
- - + +
- + {% elseif S_NEXT_STEP %}
-

{L_EXTENSION_DISABLE_IN_PROGRESS}

+

{{ lang('EXTENSION_DISABLE_IN_PROGRESS') }}

- + {% else %}
-

{L_EXTENSION_DISABLE_SUCCESS}

+

{{ lang('EXTENSION_DISABLE_SUCCESS') }}


-

{L_RETURN_TO_EXTENSION_LIST}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- + {% endif %} - +{% INCLUDE 'overall_footer.html' %} diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 8a4a35359e..ab6b2aa046 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -1,40 +1,40 @@ - +{% INCLUDE 'overall_header.html' %} -

{L_EXTENSIONS_ADMIN}

+

{{ lang('EXTENSIONS_ADMIN') }}

-

{L_EXTENSIONS_EXPLAIN}

-

{L_EXTENSION_ENABLE_EXPLAIN}

+

{{ lang('EXTENSIONS_EXPLAIN') }}

+

{{ lang('EXTENSION_ENABLE_EXPLAIN') }}

- + {% if MIGRATOR_ERROR %}
-

{L_MIGRATION_EXCEPTION_ERROR}

-

{MIGRATOR_ERROR}

-

{L_RETURN_TO_EXTENSION_LIST}

+

{{ lang('MIGRATION_EXCEPTION_ERROR') }}

+

{{ MIGRATOR_ERROR }}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- + {% elseif PRE %}
-

{L_CONFIRM}

-

{L_CONFIRM_MESSAGE}

+

{{ lang('CONFIRM') }}

+

{{ lang('CONFIRM_MESSAGE') }}

-
+
- - + +
- + {% elseif S_NEXT_STEP %}
-

{L_EXTENSION_ENABLE_IN_PROGRESS}

+

{{ lang('EXTENSION_ENABLE_IN_PROGRESS') }}

- + {% else %}
-

{L_EXTENSION_ENABLE_SUCCESS}

+

{{ lang('EXTENSION_ENABLE_SUCCESS') }}


-

{L_RETURN_TO_EXTENSION_LIST}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- + {% endif %} - +{% INCLUDE 'overall_footer.html' %} From 39b0ac4fda6d91a980c2d6ee369d53f9e81ccf2f Mon Sep 17 00:00:00 2001 From: kasimi Date: Thu, 23 Apr 2020 10:25:56 +0200 Subject: [PATCH 4/8] [ticket/16449] Fixed indentations PHPBB3-16449 --- phpBB/adm/style/acp_ext_delete_data.html | 30 ++++++++++++------------ phpBB/adm/style/acp_ext_disable.html | 20 ++++++++-------- phpBB/adm/style/acp_ext_enable.html | 30 ++++++++++++------------ 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html index a07b723e90..5ef8ed3d28 100644 --- a/phpBB/adm/style/acp_ext_delete_data.html +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -8,23 +8,23 @@

{{ lang('EXTENSION_DELETE_DATA_EXPLAIN') }}

{% if MIGRATOR_ERROR %} -
-

{{ lang('MIGRATION_EXCEPTION_ERROR') }}

-

{{ MIGRATOR_ERROR }}

-

{{ lang('RETURN_TO_EXTENSION_LIST') }}

-
+
+

{{ lang('MIGRATION_EXCEPTION_ERROR') }}

+

{{ MIGRATOR_ERROR }}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

+
{% elseif PRE %} -
-

{{ lang('CONFIRM_MESSAGE') }}

-
+
+

{{ lang('CONFIRM_MESSAGE') }}

+
-
-
- {{ lang('EXTENSION_DELETE_DATA') }} - - -
-
+
+
+ {{ lang('EXTENSION_DELETE_DATA') }} + + +
+
{% elseif S_NEXT_STEP %}

{{ lang('EXTENSION_DELETE_DATA_IN_PROGRESS') }}

diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index 3285b7f46d..64d1edbbc3 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -8,17 +8,17 @@

{{ lang('EXTENSION_DISABLE_EXPLAIN') }}

{% if PRE %} -
-

{{ lang('CONFIRM') }}

-

{{ lang('CONFIRM_MESSAGE') }}

-
+
+

{{ lang('CONFIRM') }}

+

{{ lang('CONFIRM_MESSAGE') }}

+
-
-
- - -
-
+
+
+ + +
+
{% elseif S_NEXT_STEP %}

{{ lang('EXTENSION_DISABLE_IN_PROGRESS') }}

diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index ab6b2aa046..23ca22a8c6 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -8,23 +8,23 @@

{{ lang('EXTENSION_ENABLE_EXPLAIN') }}

{% if MIGRATOR_ERROR %} -
-

{{ lang('MIGRATION_EXCEPTION_ERROR') }}

-

{{ MIGRATOR_ERROR }}

-

{{ lang('RETURN_TO_EXTENSION_LIST') }}

-
+
+

{{ lang('MIGRATION_EXCEPTION_ERROR') }}

+

{{ MIGRATOR_ERROR }}

+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

+
{% elseif PRE %} -
-

{{ lang('CONFIRM') }}

-

{{ lang('CONFIRM_MESSAGE') }}

-
+
+

{{ lang('CONFIRM') }}

+

{{ lang('CONFIRM_MESSAGE') }}

+
-
-
- - -
-
+
+
+ + +
+
{% elseif S_NEXT_STEP %}

{{ lang('EXTENSION_ENABLE_IN_PROGRESS') }}

From 976516a559ded92033e550cc71f977bfd4eb5c9e Mon Sep 17 00:00:00 2001 From: kasimi Date: Thu, 23 Apr 2020 10:31:52 +0200 Subject: [PATCH 5/8] [ticket/16449] Removed L_ prefix from CONFIRM_MESSAGE PHPBB3-16449 --- phpBB/adm/style/acp_ext_delete_data.html | 2 +- phpBB/adm/style/acp_ext_disable.html | 2 +- phpBB/adm/style/acp_ext_enable.html | 2 +- phpBB/includes/acp/acp_extensions.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html index 5ef8ed3d28..cc9ad4e416 100644 --- a/phpBB/adm/style/acp_ext_delete_data.html +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -15,7 +15,7 @@
{% elseif PRE %}
-

{{ lang('CONFIRM_MESSAGE') }}

+

{{ CONFIRM_MESSAGE }}

diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index 64d1edbbc3..066795007b 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -10,7 +10,7 @@ {% if PRE %}

{{ lang('CONFIRM') }}

-

{{ lang('CONFIRM_MESSAGE') }}

+

{{ CONFIRM_MESSAGE }}

diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 23ca22a8c6..4a2ceaadc4 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -16,7 +16,7 @@ {% elseif PRE %}

{{ lang('CONFIRM') }}

-

{{ lang('CONFIRM_MESSAGE') }}

+

{{ CONFIRM_MESSAGE }}

diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 98db47886a..d7c6ca5921 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -184,7 +184,7 @@ class acp_extensions $this->template->assign_vars(array( 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), )); break; @@ -249,7 +249,7 @@ class acp_extensions $this->template->assign_vars(array( 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), )); break; @@ -288,7 +288,7 @@ class acp_extensions $this->template->assign_vars(array( 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), + 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), )); break; From 20f68ef01371c46ac5d8e11675427c8a07ed352b Mon Sep 17 00:00:00 2001 From: kasimi Date: Thu, 23 Apr 2020 11:00:13 +0200 Subject: [PATCH 6/8] [ticket/16449] Rename template variable PRE to S_PRE_STEP PHPBB3-16449 --- phpBB/adm/style/acp_ext_delete_data.html | 2 +- phpBB/adm/style/acp_ext_disable.html | 2 +- phpBB/adm/style/acp_ext_enable.html | 2 +- phpBB/includes/acp/acp_extensions.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html index cc9ad4e416..80145e4601 100644 --- a/phpBB/adm/style/acp_ext_delete_data.html +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -13,7 +13,7 @@

{{ MIGRATOR_ERROR }}

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- {% elseif PRE %} + {% elseif S_PRE_STEP %}

{{ CONFIRM_MESSAGE }}

diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index 066795007b..30b2525810 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -7,7 +7,7 @@

{{ lang('EXTENSIONS_EXPLAIN') }}

{{ lang('EXTENSION_DISABLE_EXPLAIN') }}

- {% if PRE %} + {% if S_PRE_STEP %}

{{ lang('CONFIRM') }}

{{ CONFIRM_MESSAGE }}

diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 4a2ceaadc4..0dd2ce01d3 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -13,7 +13,7 @@

{{ MIGRATOR_ERROR }}

{{ lang('RETURN_TO_EXTENSION_LIST') }}

- {% elseif PRE %} + {% elseif S_PRE_STEP %}

{{ lang('CONFIRM') }}

{{ CONFIRM_MESSAGE }}

diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index d7c6ca5921..f8124f2206 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -183,7 +183,7 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; $this->template->assign_vars(array( - 'PRE' => true, + 'S_PRE_STEP' => true, 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), )); @@ -248,7 +248,7 @@ class acp_extensions $this->tpl_name = 'acp_ext_disable'; $this->template->assign_vars(array( - 'PRE' => true, + 'S_PRE_STEP' => true, 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), )); @@ -287,7 +287,7 @@ class acp_extensions $this->tpl_name = 'acp_ext_delete_data'; $this->template->assign_vars(array( - 'PRE' => true, + 'S_PRE_STEP' => true, 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), )); From cdd3441ead5e9b3f130fdb1a4e0384749adcc532 Mon Sep 17 00:00:00 2001 From: kasimi Date: Thu, 23 Apr 2020 11:00:45 +0200 Subject: [PATCH 7/8] [ticket/16449] Use short array syntax PHPBB3-16449 --- phpBB/includes/acp/acp_extensions.php | 33 ++++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index f8124f2206..8969e02394 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -151,13 +151,13 @@ class acp_extensions $this->list_disabled_exts(); $this->list_available_exts(); + $this->tpl_name = 'acp_ext_list'; + $this->template->assign_vars(array( 'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=list&versioncheck_force=1', 'FORCE_UNSTABLE' => $this->config['extension_force_unstable'], 'U_ACTION' => $this->u_action, )); - - $this->tpl_name = 'acp_ext_list'; break; case 'enable_pre': @@ -182,11 +182,11 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; - $this->template->assign_vars(array( + $this->template->assign_vars([ 'S_PRE_STEP' => true, 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), - )); + ]); break; case 'enable': @@ -234,9 +234,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; - $this->template->assign_vars(array( + $this->template->assign_vars([ 'U_RETURN' => $this->u_action . '&action=list', - )); + ]); break; case 'disable_pre': @@ -247,11 +247,11 @@ class acp_extensions $this->tpl_name = 'acp_ext_disable'; - $this->template->assign_vars(array( + $this->template->assign_vars([ 'S_PRE_STEP' => true, 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), - )); + ]); break; case 'disable': @@ -274,9 +274,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_disable'; - $this->template->assign_vars(array( + $this->template->assign_vars([ 'U_RETURN' => $this->u_action . '&action=list', - )); + ]); break; case 'delete_data_pre': @@ -284,13 +284,14 @@ class acp_extensions { redirect($this->u_action); } + $this->tpl_name = 'acp_ext_delete_data'; - $this->template->assign_vars(array( + $this->template->assign_vars([ 'S_PRE_STEP' => true, 'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), - )); + ]); break; case 'delete_data': @@ -320,9 +321,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_delete_data'; - $this->template->assign_vars(array( + $this->template->assign_vars([ 'U_RETURN' => $this->u_action . '&action=list', - )); + ]); break; case 'details': @@ -606,11 +607,11 @@ class acp_extensions { foreach ($actions as $lang => $url) { - $this->template->assign_block_vars($block . '.actions', array( + $this->template->assign_block_vars($block . '.actions', [ 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang), 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '', 'U_ACTION' => $url, - )); + ]); } } From e174f1475ff4b90b7b66ac46372588d3923bc342 Mon Sep 17 00:00:00 2001 From: kasimi Date: Thu, 23 Apr 2020 12:06:28 +0200 Subject: [PATCH 8/8] [ticket/16449] Don't close void elements PHPBB3-16449 --- phpBB/adm/style/acp_ext_delete_data.html | 6 +++--- phpBB/adm/style/acp_ext_disable.html | 6 +++--- phpBB/adm/style/acp_ext_enable.html | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html index 80145e4601..2d21506473 100644 --- a/phpBB/adm/style/acp_ext_delete_data.html +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -21,8 +21,8 @@
{{ lang('EXTENSION_DELETE_DATA') }} - - + +
{% elseif S_NEXT_STEP %} @@ -32,7 +32,7 @@ {% else %}

{{ lang('EXTENSION_DELETE_DATA_SUCCESS') }}

-
+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

{% endif %} diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index 30b2525810..e40279c2f4 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -15,8 +15,8 @@
- - + +
{% elseif S_NEXT_STEP %} @@ -26,7 +26,7 @@ {% else %}

{{ lang('EXTENSION_DISABLE_SUCCESS') }}

-
+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

{% endif %} diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 0dd2ce01d3..5319b76d3a 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -21,8 +21,8 @@
- - + +
{% elseif S_NEXT_STEP %} @@ -32,7 +32,7 @@ {% else %}

{{ lang('EXTENSION_ENABLE_SUCCESS') }}

-
+

{{ lang('RETURN_TO_EXTENSION_LIST') }}

{% endif %}