From e53db0775a73d1f8a639f7151fe1dda791089e47 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 1 Jul 2024 00:54:20 +0700 Subject: [PATCH] [ticket/17359] Get rid of template code duplication PHPBB-17359 --- phpBB/adm/style/acp_ext_list.html | 127 +++++++++++------------------- 1 file changed, 46 insertions(+), 81 deletions(-) diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index 526c1eb3c4..0984214c6f 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -42,87 +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} -  |  - - - - - - - - - {L_EXTENSIONS_AVAILABLE} - - - - {available.META_DISPLAY_NAME} - - - {available.META_VERSION} - - - {available.META_VERSION} - - - - {L_DETAILS} - - - - title="{available.actions.L_ACTION_EXPLAIN}">{available.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 %}