mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Merge pull request #6665 from rxu/ticket/17359
[ticket/17359] Distinct disabled and available extensions list
This commit is contained in:
commit
6ca926c146
5 changed files with 67 additions and 60 deletions
|
@ -42,59 +42,52 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- IF .enabled -->
|
||||
<tr>
|
||||
<td class="row3" colspan="4"><strong>{L_EXTENSIONS_ENABLED}</strong><!-- EVENT acp_ext_list_enabled_title_after --></td>
|
||||
</tr>
|
||||
<!-- BEGIN enabled -->
|
||||
<tr class="ext_enabled row-highlight">
|
||||
<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 class="<!-- IF enabled.S_UP_TO_DATE -->current-ext<!-- ELSE -->outdated-ext<!-- ENDIF -->">{enabled.META_VERSION}</strong>
|
||||
<!-- IF not enabled.S_UP_TO_DATE --><i class="fa fa-exclamation-circle outdated-ext" aria-hidden="true"></i><!-- ENDIF -->
|
||||
<!-- ELSE -->
|
||||
{enabled.META_VERSION}
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
<td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td>
|
||||
<td style="text-align: center;">
|
||||
<!-- BEGIN actions -->
|
||||
<a href="{enabled.actions.U_ACTION}"<!-- IF enabled.actions.L_ACTION_EXPLAIN --> title="{enabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{enabled.actions.L_ACTION}</a>
|
||||
<!-- IF not enabled.actions.S_LAST_ROW --> | <!-- ENDIF -->
|
||||
<!-- END actions -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END enabled -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .disabled -->
|
||||
<tr>
|
||||
<td class="row3" colspan="4"><strong>{L_EXTENSIONS_DISABLED}</strong><!-- EVENT acp_ext_list_disabled_title_after --></td>
|
||||
</tr>
|
||||
<!-- BEGIN disabled -->
|
||||
<tr class="ext_disabled row-highlight">
|
||||
<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 class="<!-- IF disabled.S_UP_TO_DATE -->current-ext<!-- ELSE -->outdated-ext<!-- ENDIF -->">{disabled.META_VERSION}</strong>
|
||||
<!-- IF not disabled.S_UP_TO_DATE --><i class="fa fa-exclamation-circle outdated-ext" aria-hidden="true"></i><!-- ENDIF -->
|
||||
<!-- ELSE -->
|
||||
{disabled.META_VERSION}
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<!-- IF disabled.U_DETAILS --><a href="{disabled.U_DETAILS}">{L_DETAILS}</a><!-- ENDIF -->
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<!-- BEGIN actions -->
|
||||
<a href="{disabled.actions.U_ACTION}"<!-- IF disabled.actions.L_ACTION_EXPLAIN --> title="{disabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{disabled.actions.L_ACTION}</a>
|
||||
<!-- IF not disabled.actions.S_LAST_ROW --> | <!-- ENDIF -->
|
||||
<!-- END actions -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END disabled -->
|
||||
<!-- ENDIF -->
|
||||
{% for list in ['enabled', 'disabled', 'available'] %}
|
||||
{% set blockname = attribute(loops, list) %}
|
||||
{% if blockname|length %}
|
||||
<tr>
|
||||
<td class="row3" colspan="4"><strong>{{ lang('EXTENSIONS_' ~ list|upper) }}</strong>
|
||||
{% 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 %}
|
||||
</td>
|
||||
</tr>
|
||||
{% for data in blockname %}
|
||||
<tr class="ext_{{ list }} row-highlight">
|
||||
<td><strong title="{{ data.NAME }}">{{ data.META_DISPLAY_NAME }}</strong>
|
||||
{% 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 %}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
{% if data.S_VERSIONCHECK %}
|
||||
<strong class="{% if data.S_UP_TO_DATE %}current-ext{% else %}outdated-ext{% endif %}">{{ data.META_VERSION }}</strong>
|
||||
{% if not data.S_UP_TO_DATE %}<i class="fa fa-exclamation-circle outdated-ext" aria-hidden="true"></i>{% endif %}
|
||||
{% else %}
|
||||
{{ data.META_VERSION }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
{% if data.U_DETAILS %}<a href="{{ data.U_DETAILS }}">{{ lang ('DETAILS') }}</a>{% endif %}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
{% for actions in data.actions %}
|
||||
<a href="{{ actions.U_ACTION }}"{% if actions.L_ACTION_EXPLAIN %} title="{{ actions.L_ACTION_EXPLAIN }}"{% endif %}>{{ actions.L_ACTION }}</a>
|
||||
{% if not actions.S_LAST_ROW %} | {% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
'DETAILS' => 'Details',
|
||||
|
||||
'EXTENSIONS_AVAILABLE' => 'Available Extensions',
|
||||
'EXTENSIONS_DISABLED' => 'Disabled Extensions',
|
||||
'EXTENSIONS_ENABLED' => 'Enabled Extensions',
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue