diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index 9e019fa1c2..0984214c6f 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -42,59 +42,52 @@ - - - {L_EXTENSIONS_ENABLED} - - - - {enabled.META_DISPLAY_NAME} - - - {enabled.META_VERSION} - - - {enabled.META_VERSION} - - - {L_DETAILS} - - - title="{enabled.actions.L_ACTION_EXPLAIN}">{enabled.actions.L_ACTION} -  |  - - - - - - - - - {L_EXTENSIONS_DISABLED} - - - - {disabled.META_DISPLAY_NAME} - - - {disabled.META_VERSION} - - - {disabled.META_VERSION} - - - - {L_DETAILS} - - - - title="{disabled.actions.L_ACTION_EXPLAIN}">{disabled.actions.L_ACTION} -  |  - - - - - + {% for list in ['enabled', 'disabled', 'available'] %} + {% set blockname = attribute(loops, list) %} + {% if blockname|length %} + + {{ lang('EXTENSIONS_' ~ list|upper) }} + {% if list == 'enabled' %} + {% EVENT acp_ext_list_enabled_title_after %} + {% elseif list == 'disabled' %} + {% EVENT acp_ext_list_disabled_title_after %} + {% elseif list == 'available' %} + {% EVENT acp_ext_list_available_title_after %} + {% endif %} + + + {% for data in blockname %} + + {{ data.META_DISPLAY_NAME }} + {% if list == 'enabled' %} + {% EVENT acp_ext_list_enabled_name_after %} + {% elseif list == 'disabled' %} + {% EVENT acp_ext_list_disabled_name_after %} + {% elseif list == 'available' %} + {% EVENT acp_ext_list_available_name_after %} + {% endif %} + + + {% if data.S_VERSIONCHECK %} + {{ data.META_VERSION }} + {% if not data.S_UP_TO_DATE %}{% endif %} + {% else %} + {{ data.META_VERSION }} + {% endif %} + + + {% if data.U_DETAILS %}{{ lang ('DETAILS') }}{% endif %} + + + {% for actions in data.actions %} + {{ actions.L_ACTION }} + {% if not actions.S_LAST_ROW %} | {% endif %} + {% endfor %} + + + {% endfor %} + {% endif %} + {% endfor %} diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 07e3b83beb..2578c967ab 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -70,6 +70,18 @@ acp_ext_details_notice * Since: 3.1.11-RC1 * Purpose: Add extension detail notices after version check information. +acp_ext_list_available_name_after +=== +* Location: adm/style/acp_ext_list.html +* Since: 3.3.14-RC1 +* Purpose: Add content after the name of available extensions in the list + +acp_ext_list_available_title_after +=== +* Location: adm/style/acp_ext_list.html +* Since: 3.3.14-RC1 +* Purpose: Add text after available extensions section title. + acp_ext_list_disabled_name_after === * Location: adm/style/acp_ext_list.html diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 17281a111a..f481f764d1 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -575,7 +575,7 @@ class acp_extensions catch (exception_interface $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); - $this->template->assign_block_vars('disabled', array( + $this->template->assign_block_vars('available', array( 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $message), 'S_VERSIONCHECK' => false, )); @@ -589,9 +589,9 @@ class acp_extensions $block_vars['NAME'] = $name; $block_vars['U_DETAILS'] = $this->u_action . '&action=details&ext_name=' . urlencode($name); - $this->template->assign_block_vars('disabled', $block_vars); + $this->template->assign_block_vars('available', $block_vars); - $this->output_actions('disabled', array( + $this->output_actions('available', array( 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), )); } diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index a96a7a2a2b..16668b5161 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -47,6 +47,7 @@ $lang = array_merge($lang, array( 'DETAILS' => 'Details', + 'EXTENSIONS_AVAILABLE' => 'Available Extensions', 'EXTENSIONS_DISABLED' => 'Disabled Extensions', 'EXTENSIONS_ENABLED' => 'Enabled Extensions', diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 2f26c53ce5..3ecdd6e05c 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -84,7 +84,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); $this->assertCount(1, $crawler->filter('.ext_enabled')); - $this->assertCount(7, $crawler->filter('.ext_disabled')); + $this->assertCount(3, $crawler->filter('.ext_disabled')); + $this->assertCount(4, $crawler->filter('.ext_available')); $this->assertStringContainsString('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); $this->assertContainsLang('EXTENSION_DISABLE', $crawler->filter('.ext_enabled')->eq(0)->text()); @@ -98,9 +99,9 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertStringContainsString('The “vendor/test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); - $this->assertStringContainsString('phpBB Bar Extension', $crawler->filter('.ext_disabled')->eq(3)->text()); - $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(3)->text()); - $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(3)->text()); + $this->assertStringContainsString('phpBB Bar Extension', $crawler->filter('.ext_available')->eq(0)->text()); + $this->assertContainsLang('DETAILS', $crawler->filter('.ext_available')->eq(0)->text()); + $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_available')->eq(0)->text()); // Check that invalid extensions are not listed. $this->assertStringNotContainsString('phpBB BarFoo Extension', $crawler->filter('.table1')->text());