1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10631] Make failure to meet ext enable requirements clearer

Turn the blocks red on the details page if requirement is not met.

Also changing a how the errors come up when trying to enable/disable
an extension when they cannot be.

PHPBB3-10631
This commit is contained in:
Nathan Guse
2012-08-05 19:00:20 -05:00
committed by Unknown Bliss
parent dce04b2d03
commit 7b643fe8a5
5 changed files with 39 additions and 21 deletions

View File

@@ -43,7 +43,7 @@ class acp_extensions
$action = $request->variable('action', 'list');
$ext_name = $request->variable('ext_name', '');
// Cancel action
if ($request->is_set_post('cancel'))
{
@@ -79,9 +79,14 @@ class acp_extensions
break;
case 'enable_pre':
if (!$md_manager->validate_enable() || $phpbb_extension_manager->enabled($ext_name))
if (!$md_manager->validate_enable())
{
trigger_error('EXTENSION_NOT_AVAILABLE');
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action));
}
if ($phpbb_extension_manager->enabled($ext_name))
{
redirect($this->u_action);
}
$this->tpl_name = 'acp_ext_enable';
@@ -95,7 +100,7 @@ class acp_extensions
case 'enable':
if (!$md_manager->validate_enable())
{
trigger_error('EXTENSION_NOT_AVAILABLE');
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action));
}
if ($phpbb_extension_manager->enable_step($ext_name))
@@ -115,7 +120,7 @@ class acp_extensions
case 'disable_pre':
if (!$phpbb_extension_manager->enabled($ext_name))
{
trigger_error('EXTENSION_NOT_AVAILABLE');
redirect($this->u_action);
}
$this->tpl_name = 'acp_ext_disable';

View File

@@ -320,8 +320,13 @@ class phpbb_extension_metadata_manager
'MD_VERSION' => (isset($this->metadata['version'])) ? htmlspecialchars($this->metadata['version']) : '',
'MD_TIME' => (isset($this->metadata['time'])) ? htmlspecialchars($this->metadata['time']) : '',
'MD_LICENCE' => htmlspecialchars($this->metadata['licence']),
'MD_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
'MD_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb']) : '',
'MD_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
'MD_REQUIRE_PHP_FAIL' => !$this->validate_require_php(),
'MD_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb']) : '',
'MD_REQUIRE_PHPBB_FAIL' => !$this->validate_require_phpbb(),
'MD_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '',
));