From 8d5fcc8d4ca85c2752771ba7c808ed4e19c3c773 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Nov 2013 15:33:31 +0100 Subject: [PATCH] [ticket/11994] Make extension manager UI less misleading Enable and Install were split into two different expressions. Purge was renamed to uninstall to make clearer what is going to happen. PHPBB3-11994 --- phpBB/adm/style/acp_ext_disable.html | 14 ++++---- phpBB/adm/style/acp_ext_enable.html | 16 ++++----- phpBB/adm/style/acp_ext_list.html | 10 +++--- phpBB/adm/style/acp_ext_purge.html | 16 ++++----- phpBB/includes/acp/acp_extensions.php | 34 +++++++++++------- phpBB/language/en/acp/extensions.php | 51 +++++++++++++-------------- 6 files changed, 72 insertions(+), 69 deletions(-) diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index 7dc3f6ec97..4fa0893be7 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -5,29 +5,29 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_DISABLE_EXPLAIN}

+

{L_EXTENSION_DISABLE_EXPLAIN}

-

{L_DISABLE_CONFIRM}

+

{L_CONFIRM_MESSAGE}

- {L_DISABLE} - + {L_EXTENSION_DISABLE} +
-

{L_DISABLE_IN_PROGRESS}

+

{L_EXTENSION_DISABLE_IN_PROGRESS}

-

{L_DISABLE_SUCCESS}

+

{L_EXTENSION_DISABLE_SUCCESS}


-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 35585207eb..2a8c638b1d 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -5,35 +5,35 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_ENABLE_EXPLAIN}

+

{L_EXTENSION_ENABLE_EXPLAIN}{L_EXTENSION_INSTALL_EXPLAIN}

{L_MIGRATION_EXCEPTION_ERROR}

{MIGRATOR_ERROR}

-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

-

{L_ENABLE_CONFIRM}

+

{L_CONFIRM_MESSAGE}

- {L_ENABLE} - + {L_EXTENSION_ENABLE}{L_EXTENSION_INSTALL} +
-

{L_ENABLE_IN_PROGRESS}

+

{L_EXTENSION_ENABLE_IN_PROGRESS}{L_EXTENSION_INSTALL_IN_PROGRESS}

-

{L_ENABLE_SUCCESS}

+

{L_EXTENSION_ENABLE_SUCCESS}{L_EXTENSION_INSTALL_SUCCESS}


-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index 390b3e79f0..8408ebe748 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -18,9 +18,7 @@ - - {L_ENABLED} {L_EXTENSIONS} - + {L_EXTENSIONS_ENABLED} @@ -28,7 +26,7 @@ {L_DETAILS} - {enabled.actions.L_ACTION} + title="{enabled.actions.L_ACTION_EXPLAIN}">{enabled.actions.L_ACTION}  |  @@ -38,7 +36,7 @@ - {L_DISABLED} {L_EXTENSIONS} + {L_EXTENSIONS_DISABLED} @@ -48,7 +46,7 @@ - {disabled.actions.L_ACTION} + title="{disabled.actions.L_ACTION_EXPLAIN}">{disabled.actions.L_ACTION}  |  diff --git a/phpBB/adm/style/acp_ext_purge.html b/phpBB/adm/style/acp_ext_purge.html index 94bef82ca5..310efd0e1d 100644 --- a/phpBB/adm/style/acp_ext_purge.html +++ b/phpBB/adm/style/acp_ext_purge.html @@ -5,35 +5,35 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_PURGE_EXPLAIN}

+

{L_EXTENSION_UNINSTALL_EXPLAIN}

{L_MIGRATION_EXCEPTION_ERROR}

{MIGRATOR_ERROR}

-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

-

{L_PURGE_CONFIRM}

+

{L_CONFIRM_MESSAGE}

- {L_PURGE} - + {L_EXTENSION_UNINSTALL} +
-

{L_PURGE_IN_PROGRESS}

+

{L_EXTENSION_UNINSTALL_IN_PROGRESS}

-

{L_PURGE_SUCCESS}

+

{L_EXTENSION_UNINSTALL_SUCCESS}


-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index b41f4d4e81..896c911859 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -83,6 +83,7 @@ class acp_extensions break; case 'enable_pre': + case 'install_pre': if (!$md_manager->validate_enable()) { trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -96,12 +97,15 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; $template->assign_vars(array( - 'PRE' => true, - 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name), + 'PRE' => true, + 'IS_ENABLING' => $action == 'enable_pre', + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_' . (($action == 'enable_pre') ? 'ENABLE' : 'INSTALL') . '_CONFIRM', $ext_name), + 'U_ENABLE' => $this->u_action . '&action=' . (($action == 'enable_pre') ? 'enable' : 'install') . '&ext_name=' . urlencode($ext_name), )); break; case 'enable': + case 'install': if (!$md_manager->validate_enable()) { trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -116,7 +120,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=' . $action . '&ext_name=' . urlencode($ext_name)); } } } @@ -128,7 +132,8 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; $template->assign_vars(array( - 'U_RETURN' => $this->u_action . '&action=list', + 'IS_ENABLING' => $action == 'enable', + 'U_RETURN' => $this->u_action . '&action=list', )); break; @@ -141,8 +146,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_disable'; $template->assign_vars(array( - 'PRE' => true, - 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $ext_name), + 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), )); break; @@ -169,8 +175,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_purge'; $template->assign_vars(array( - 'PRE' => true, - 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_UNINSTALL_CONFIRM', $ext_name), + 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), )); break; @@ -233,7 +240,7 @@ class acp_extensions $this->output_actions('enabled', array( 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($name), - 'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + 'UNINSTALL' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -267,7 +274,7 @@ class acp_extensions $this->output_actions('disabled', array( 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), - 'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + 'UNINSTALL' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -302,7 +309,7 @@ class acp_extensions )); $this->output_actions('disabled', array( - 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), + 'INSTALL' => $this->u_action . '&action=install_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -325,8 +332,9 @@ class acp_extensions foreach ($actions as $lang => $url) { $this->template->assign_block_vars($block . '.actions', array( - 'L_ACTION' => $this->user->lang($lang), - 'U_ACTION' => $url, + 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang), + 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '', + 'U_ACTION' => $url, )); } } diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 369397ead2..d97100da70 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -39,47 +39,44 @@ $lang = array_merge($lang, array( 'EXTENSIONS' => 'Extensions', 'EXTENSIONS_ADMIN' => 'Extensions Manager', 'EXTENSIONS_EXPLAIN' => 'The Extensions Manager is a tool in your phpBB Board which allows you to manage all of your extensions statuses and view information about them.', - 'EXTENSION_INVALID_LIST' => 'The "%s" extension is not valid.
%s

', + 'EXTENSION_INVALID_LIST' => 'The “%s” extension is not valid.
%s

', 'EXTENSION_NOT_AVAILABLE' => 'The selected extension is not available for this board, please verify your phpBB and PHP versions are allowed (see the details page).', 'DETAILS' => 'Details', - 'AVAILABLE' => 'Available', - 'ENABLED' => 'Enabled', - 'DISABLED' => 'Disabled', - 'PURGED' => 'Purged', - 'UPLOADED' => 'Uploaded', + 'EXTENSIONS_ENABLED' => 'Enabled Extensions', + 'EXTENSIONS_DISABLED' => 'Disabled Extensions', - 'ENABLE' => 'Enable', - 'DISABLE' => 'Disable', - 'PURGE' => 'Purge', + 'EXTENSION_DISABLE' => 'Disable', + 'EXTENSION_ENABLE' => 'Enable', + 'EXTENSION_INSTALL' => 'Install', + 'EXTENSION_UNINSTALL' => 'Uninstall', - 'ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', - 'DISABLE_EXPLAIN' => 'Disabling an extension retains its files and settings but removes any functionality added by the extension.', - 'PURGE_EXPLAIN' => 'Purging an extension clears an extensions data while retaining its files.', - 'DELETE_EXPLAIN' => 'Deleting an extension removes all of its files and settings. Log entries will remain, although any language variables added by the extension will not be available.', + 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', + 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', + 'EXTENSION_INSTALL_EXPLAIN' => 'Installing an extension will perform database changes that are required to use the extension on your board.', + 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all data and settings of the extensions. Only the extension files are retained, so you can install it again.', - 'DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave this page or refresh until it is completed.', - 'ENABLE_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.', - 'PURGE_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.', - 'ENABLE_SUCCESS' => 'The extension was enabled successfully', - 'DISABLE_SUCCESS' => 'The extension was disabled successfully', - 'PURGE_SUCCESS' => 'The extension was purged successfully', + 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave this page or refresh until it is completed.', + 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave this page or refresh until it is completed.', + 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.', + 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.', - 'ENABLE_FAIL' => 'The extension could not be enabled', - 'DISABLE_FAIL' => 'The extension could not be disabled', - 'PURGE_FAIL' => 'The extension could not be purged', + 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', + 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', + 'EXTENSION_INSTALL_SUCCESS' => 'The extension was installed successfully', + 'EXTENSION_UNINSTALL_SUCCESS' => 'The extension was uninstalled successfully', 'EXTENSION_NAME' => 'Extension Name', 'EXTENSION_ACTIONS' => 'Actions', 'EXTENSION_OPTIONS' => 'Options', - 'ENABLE_CONFIRM' => 'Are you sure that you wish to enable this extension?', - 'DISABLE_CONFIRM' => 'Are you sure that you wish to disable this extension?', - 'PURGE_CONFIRM' => 'Are you sure that you wish to purge this extension's data? This will remove all settings stored for this extension and cannot be undone!', + 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?', + 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?', + 'EXTENSION_INSTALL_CONFIRM' => 'Are you sure that you wish to install the “%s” extension?', + 'EXTENSION_UNINSTALL_CONFIRM' => 'Are you sure that you wish to uninstall the “%s” extension? This will remove all data and settings stored for this extension and cannot be undone!', - 'WARNING' => 'Warning', - 'RETURN' => 'Return', + 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list', 'EXT_DETAILS' => 'Extension Details', 'DISPLAY_NAME' => 'Display Name',