diff options
author | Jakub Senko <jakubsenko@gmail.com> | 2019-03-27 12:09:55 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-09-30 20:25:44 +0200 |
commit | 975fe1e153c35d7079d06655c43303b04a6502a7 (patch) | |
tree | bdbf4c6a239e9f751b27c4bb45a679abf94b73b7 /phpBB/includes/acp | |
parent | b6c230753ee17fe65b43929d4fc10248ea2a23bf (diff) | |
download | forums-975fe1e153c35d7079d06655c43303b04a6502a7.tar forums-975fe1e153c35d7079d06655c43303b04a6502a7.tar.gz forums-975fe1e153c35d7079d06655c43303b04a6502a7.tar.bz2 forums-975fe1e153c35d7079d06655c43303b04a6502a7.tar.xz forums-975fe1e153c35d7079d06655c43303b04a6502a7.zip |
[ticket/15257] Provide extension not enableable messages
PHPBB3-15257
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 2929de3c4f..da03b576bf 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -172,10 +172,8 @@ class acp_extensions } $extension = $this->ext_manager->get_extension($ext_name); - if (!$extension->is_enableable()) - { - trigger_error($this->user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING); - } + + $this->check_is_enableable($extension->is_enableable()); if ($this->ext_manager->is_enabled($ext_name)) { @@ -209,10 +207,8 @@ class acp_extensions } $extension = $this->ext_manager->get_extension($ext_name); - if (!$extension->is_enableable()) - { - trigger_error($this->user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING); - } + + $this->check_is_enableable($extension->is_enableable()); try { @@ -727,4 +723,14 @@ class acp_extensions )); } } + + protected function check_is_enableable($enableable) + { + if ($enableable !== true) + { + $message = !empty($enableable) ? $enableable : $this->user->lang('EXTENSION_NOT_ENABLEABLE'); + $message = is_array($message) ? implode('<br />', $message) : $message; + trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING); + } + } } |