[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
This commit is contained in:
Joas Schilling 2013-11-01 15:33:31 +01:00
parent cc54e6a9e5
commit 8d5fcc8d4c
6 changed files with 72 additions and 69 deletions

View file

@ -5,29 +5,29 @@
<h1>{L_EXTENSIONS_ADMIN}</h1> <h1>{L_EXTENSIONS_ADMIN}</h1>
<p>{L_EXTENSIONS_EXPLAIN}</p> <p>{L_EXTENSIONS_EXPLAIN}</p>
<p>{L_DISABLE_EXPLAIN}</p> <p>{L_EXTENSION_DISABLE_EXPLAIN}</p>
<!-- IF PRE --> <!-- IF PRE -->
<div class="errorbox"> <div class="errorbox">
<p>{L_DISABLE_CONFIRM}</p> <p>{L_CONFIRM_MESSAGE}</p>
</div> </div>
<form id="acp_extensions" method="post" action="{U_DISABLE}"> <form id="acp_extensions" method="post" action="{U_DISABLE}">
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_DISABLE}</legend> <legend>{L_EXTENSION_DISABLE}</legend>
<input class="button1" type="submit" name="disable" value="{L_DISABLE}" /> <input class="button1" type="submit" name="disable" value="{L_EXTENSION_DISABLE}" />
<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
</fieldset> </fieldset>
</form> </form>
<!-- ELSEIF S_NEXT_STEP --> <!-- ELSEIF S_NEXT_STEP -->
<div class="errorbox"> <div class="errorbox">
<p>{L_DISABLE_IN_PROGRESS}</p> <p>{L_EXTENSION_DISABLE_IN_PROGRESS}</p>
</div> </div>
<!-- ELSE --> <!-- ELSE -->
<div class="successbox"> <div class="successbox">
<p>{L_DISABLE_SUCCESS}</p> <p>{L_EXTENSION_DISABLE_SUCCESS}</p>
<br /> <br />
<p><a href="{U_RETURN}">{L_RETURN}</a></p> <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -5,35 +5,35 @@
<h1>{L_EXTENSIONS_ADMIN}</h1> <h1>{L_EXTENSIONS_ADMIN}</h1>
<p>{L_EXTENSIONS_EXPLAIN}</p> <p>{L_EXTENSIONS_EXPLAIN}</p>
<p>{L_ENABLE_EXPLAIN}</p> <p><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE_EXPLAIN}<!-- ELSE -->{L_EXTENSION_INSTALL_EXPLAIN}<!-- ENDIF --></p>
<!-- IF MIGRATOR_ERROR --> <!-- IF MIGRATOR_ERROR -->
<div class="errorbox"> <div class="errorbox">
<p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p> <p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
<p>{MIGRATOR_ERROR}</p> <p>{MIGRATOR_ERROR}</p>
<p><a href="{U_RETURN}">{L_RETURN}</a></p> <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
</div> </div>
<!-- ELSEIF PRE --> <!-- ELSEIF PRE -->
<div class="errorbox"> <div class="errorbox">
<p>{L_ENABLE_CONFIRM}</p> <p>{L_CONFIRM_MESSAGE}</p>
</div> </div>
<form id="acp_extensions" method="post" action="{U_ENABLE}"> <form id="acp_extensions" method="post" action="{U_ENABLE}">
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_ENABLE}</legend> <legend><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE}<!-- ELSE -->{L_EXTENSION_INSTALL}<!-- ENDIF --></legend>
<input class="button1" type="submit" name="enable" value="{L_ENABLE}" /> <input class="button1" type="submit" name="enable" value="<!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE}<!-- ELSE -->{L_EXTENSION_INSTALL}<!-- ENDIF -->" />
<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
</fieldset> </fieldset>
</form> </form>
<!-- ELSEIF S_NEXT_STEP --> <!-- ELSEIF S_NEXT_STEP -->
<div class="errorbox"> <div class="errorbox">
<p>{L_ENABLE_IN_PROGRESS}</p> <p><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE_IN_PROGRESS}<!-- ELSE -->{L_EXTENSION_INSTALL_IN_PROGRESS}<!-- ENDIF --></p>
</div> </div>
<!-- ELSE --> <!-- ELSE -->
<div class="successbox"> <div class="successbox">
<p>{L_ENABLE_SUCCESS}</p> <p><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE_SUCCESS}<!-- ELSE -->{L_EXTENSION_INSTALL_SUCCESS}<!-- ENDIF --></p>
<br /> <br />
<p><a href="{U_RETURN}">{L_RETURN}</a></p> <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -18,9 +18,7 @@
<tbody> <tbody>
<!-- IF .enabled --> <!-- IF .enabled -->
<tr> <tr>
<td class="row3" colspan="3"> <td class="row3" colspan="3"><strong>{L_EXTENSIONS_ENABLED}</strong></td>
<strong>{L_ENABLED} {L_EXTENSIONS}</strong>
</td>
</tr> </tr>
<!-- BEGIN enabled --> <!-- BEGIN enabled -->
<tr class="ext_enabled"> <tr class="ext_enabled">
@ -28,7 +26,7 @@
<td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td> <td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td>
<td style="text-align: center;"> <td style="text-align: center;">
<!-- BEGIN actions --> <!-- BEGIN actions -->
<a href="{enabled.actions.U_ACTION}" title="{enabled.actions.L_ACTION}">{enabled.actions.L_ACTION}</a> <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 -->&nbsp;|&nbsp;<!-- ENDIF --> <!-- IF not enabled.actions.S_LAST_ROW -->&nbsp;|&nbsp;<!-- ENDIF -->
<!-- END actions --> <!-- END actions -->
</td> </td>
@ -38,7 +36,7 @@
<!-- IF .disabled --> <!-- IF .disabled -->
<tr> <tr>
<td class="row3" colspan="3"><strong>{L_DISABLED} {L_EXTENSIONS}</strong></td> <td class="row3" colspan="3"><strong>{L_EXTENSIONS_DISABLED}</strong></td>
</tr> </tr>
<!-- BEGIN disabled --> <!-- BEGIN disabled -->
<tr class="ext_disabled"> <tr class="ext_disabled">
@ -48,7 +46,7 @@
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<!-- BEGIN actions --> <!-- BEGIN actions -->
<a href="{disabled.actions.U_ACTION}" title="{disabled.actions.L_ACTION}">{disabled.actions.L_ACTION}</a> <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 -->&nbsp;|&nbsp;<!-- ENDIF --> <!-- IF not disabled.actions.S_LAST_ROW -->&nbsp;|&nbsp;<!-- ENDIF -->
<!-- END actions --> <!-- END actions -->
</td> </td>

View file

@ -5,35 +5,35 @@
<h1>{L_EXTENSIONS_ADMIN}</h1> <h1>{L_EXTENSIONS_ADMIN}</h1>
<p>{L_EXTENSIONS_EXPLAIN}</p> <p>{L_EXTENSIONS_EXPLAIN}</p>
<p>{L_PURGE_EXPLAIN}</p> <p>{L_EXTENSION_UNINSTALL_EXPLAIN}</p>
<!-- IF MIGRATOR_ERROR --> <!-- IF MIGRATOR_ERROR -->
<div class="errorbox"> <div class="errorbox">
<p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p> <p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
<p>{MIGRATOR_ERROR}</p> <p>{MIGRATOR_ERROR}</p>
<p><a href="{U_RETURN}">{L_RETURN}</a></p> <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
</div> </div>
<!-- ELSEIF PRE --> <!-- ELSEIF PRE -->
<div class="errorbox"> <div class="errorbox">
<p>{L_PURGE_CONFIRM}</p> <p>{L_CONFIRM_MESSAGE}</p>
</div> </div>
<form id="acp_extensions" method="post" action="{U_PURGE}"> <form id="acp_extensions" method="post" action="{U_PURGE}">
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_PURGE}</legend> <legend>{L_EXTENSION_UNINSTALL}</legend>
<input class="button1" type="submit" name="purge" value="{L_PURGE}" /> <input class="button1" type="submit" name="purge" value="{L_EXTENSION_UNINSTALL}" />
<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
</fieldset> </fieldset>
</form> </form>
<!-- ELSEIF S_NEXT_STEP --> <!-- ELSEIF S_NEXT_STEP -->
<div class="errorbox"> <div class="errorbox">
<p>{L_PURGE_IN_PROGRESS}</p> <p>{L_EXTENSION_UNINSTALL_IN_PROGRESS}</p>
</div> </div>
<!-- ELSE --> <!-- ELSE -->
<div class="successbox"> <div class="successbox">
<p>{L_PURGE_SUCCESS}</p> <p>{L_EXTENSION_UNINSTALL_SUCCESS}</p>
<br /> <br />
<p><a href="{U_RETURN}">{L_RETURN}</a></p> <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -83,6 +83,7 @@ class acp_extensions
break; break;
case 'enable_pre': case 'enable_pre':
case 'install_pre':
if (!$md_manager->validate_enable()) if (!$md_manager->validate_enable())
{ {
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); 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'; $this->tpl_name = 'acp_ext_enable';
$template->assign_vars(array( $template->assign_vars(array(
'PRE' => true, 'PRE' => true,
'U_ENABLE' => $this->u_action . '&amp;action=enable&amp;ext_name=' . urlencode($ext_name), '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 . '&amp;action=' . (($action == 'enable_pre') ? 'enable' : 'install') . '&amp;ext_name=' . urlencode($ext_name),
)); ));
break; break;
case 'enable': case 'enable':
case 'install':
if (!$md_manager->validate_enable()) if (!$md_manager->validate_enable())
{ {
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); 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); $template->assign_var('S_NEXT_STEP', true);
meta_refresh(0, $this->u_action . '&amp;action=enable&amp;ext_name=' . urlencode($ext_name)); meta_refresh(0, $this->u_action . '&amp;action=' . $action . '&amp;ext_name=' . urlencode($ext_name));
} }
} }
} }
@ -128,7 +132,8 @@ class acp_extensions
$this->tpl_name = 'acp_ext_enable'; $this->tpl_name = 'acp_ext_enable';
$template->assign_vars(array( $template->assign_vars(array(
'U_RETURN' => $this->u_action . '&amp;action=list', 'IS_ENABLING' => $action == 'enable',
'U_RETURN' => $this->u_action . '&amp;action=list',
)); ));
break; break;
@ -141,8 +146,9 @@ class acp_extensions
$this->tpl_name = 'acp_ext_disable'; $this->tpl_name = 'acp_ext_disable';
$template->assign_vars(array( $template->assign_vars(array(
'PRE' => true, 'PRE' => true,
'U_DISABLE' => $this->u_action . '&amp;action=disable&amp;ext_name=' . urlencode($ext_name), 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $ext_name),
'U_DISABLE' => $this->u_action . '&amp;action=disable&amp;ext_name=' . urlencode($ext_name),
)); ));
break; break;
@ -169,8 +175,9 @@ class acp_extensions
$this->tpl_name = 'acp_ext_purge'; $this->tpl_name = 'acp_ext_purge';
$template->assign_vars(array( $template->assign_vars(array(
'PRE' => true, 'PRE' => true,
'U_PURGE' => $this->u_action . '&amp;action=purge&amp;ext_name=' . urlencode($ext_name), 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_UNINSTALL_CONFIRM', $ext_name),
'U_PURGE' => $this->u_action . '&amp;action=purge&amp;ext_name=' . urlencode($ext_name),
)); ));
break; break;
@ -233,7 +240,7 @@ class acp_extensions
$this->output_actions('enabled', array( $this->output_actions('enabled', array(
'DISABLE' => $this->u_action . '&amp;action=disable_pre&amp;ext_name=' . urlencode($name), 'DISABLE' => $this->u_action . '&amp;action=disable_pre&amp;ext_name=' . urlencode($name),
'PURGE' => $this->u_action . '&amp;action=purge_pre&amp;ext_name=' . urlencode($name), 'UNINSTALL' => $this->u_action . '&amp;action=purge_pre&amp;ext_name=' . urlencode($name),
)); ));
} }
catch(\phpbb\extension\exception $e) catch(\phpbb\extension\exception $e)
@ -267,7 +274,7 @@ class acp_extensions
$this->output_actions('disabled', array( $this->output_actions('disabled', array(
'ENABLE' => $this->u_action . '&amp;action=enable_pre&amp;ext_name=' . urlencode($name), 'ENABLE' => $this->u_action . '&amp;action=enable_pre&amp;ext_name=' . urlencode($name),
'PURGE' => $this->u_action . '&amp;action=purge_pre&amp;ext_name=' . urlencode($name), 'UNINSTALL' => $this->u_action . '&amp;action=purge_pre&amp;ext_name=' . urlencode($name),
)); ));
} }
catch(\phpbb\extension\exception $e) catch(\phpbb\extension\exception $e)
@ -302,7 +309,7 @@ class acp_extensions
)); ));
$this->output_actions('disabled', array( $this->output_actions('disabled', array(
'ENABLE' => $this->u_action . '&amp;action=enable_pre&amp;ext_name=' . urlencode($name), 'INSTALL' => $this->u_action . '&amp;action=install_pre&amp;ext_name=' . urlencode($name),
)); ));
} }
catch(\phpbb\extension\exception $e) catch(\phpbb\extension\exception $e)
@ -325,8 +332,9 @@ class acp_extensions
foreach ($actions as $lang => $url) foreach ($actions as $lang => $url)
{ {
$this->template->assign_block_vars($block . '.actions', array( $this->template->assign_block_vars($block . '.actions', array(
'L_ACTION' => $this->user->lang($lang), 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang),
'U_ACTION' => $url, 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '',
'U_ACTION' => $url,
)); ));
} }
} }

View file

@ -39,47 +39,44 @@ $lang = array_merge($lang, array(
'EXTENSIONS' => 'Extensions', 'EXTENSIONS' => 'Extensions',
'EXTENSIONS_ADMIN' => 'Extensions Manager', '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.', '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.<br />%s<br /><br />', 'EXTENSION_INVALID_LIST' => 'The “%s” extension is not valid.<br />%s<br /><br />',
'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).', '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', 'DETAILS' => 'Details',
'AVAILABLE' => 'Available', 'EXTENSIONS_ENABLED' => 'Enabled Extensions',
'ENABLED' => 'Enabled', 'EXTENSIONS_DISABLED' => 'Disabled Extensions',
'DISABLED' => 'Disabled',
'PURGED' => 'Purged',
'UPLOADED' => 'Uploaded',
'ENABLE' => 'Enable', 'EXTENSION_DISABLE' => 'Disable',
'DISABLE' => 'Disable', 'EXTENSION_ENABLE' => 'Enable',
'PURGE' => 'Purge', 'EXTENSION_INSTALL' => 'Install',
'EXTENSION_UNINSTALL' => 'Uninstall',
'ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.',
'DISABLE_EXPLAIN' => 'Disabling an extension retains its files and settings but removes any functionality added by the extension.', 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.',
'PURGE_EXPLAIN' => 'Purging an extension clears an extensions data while retaining its files.', 'EXTENSION_INSTALL_EXPLAIN' => 'Installing an extension will perform database changes that are required to use the extension on your board.',
'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_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.', 'EXTENSION_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.', 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, 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.', 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.',
'ENABLE_SUCCESS' => 'The extension was enabled successfully', 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.',
'DISABLE_SUCCESS' => 'The extension was disabled successfully',
'PURGE_SUCCESS' => 'The extension was purged successfully',
'ENABLE_FAIL' => 'The extension could not be enabled', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully',
'DISABLE_FAIL' => 'The extension could not be disabled', 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully',
'PURGE_FAIL' => 'The extension could not be purged', 'EXTENSION_INSTALL_SUCCESS' => 'The extension was installed successfully',
'EXTENSION_UNINSTALL_SUCCESS' => 'The extension was uninstalled successfully',
'EXTENSION_NAME' => 'Extension Name', 'EXTENSION_NAME' => 'Extension Name',
'EXTENSION_ACTIONS' => 'Actions', 'EXTENSION_ACTIONS' => 'Actions',
'EXTENSION_OPTIONS' => 'Options', 'EXTENSION_OPTIONS' => 'Options',
'ENABLE_CONFIRM' => 'Are you sure that you wish to enable this extension?', 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?',
'DISABLE_CONFIRM' => 'Are you sure that you wish to disable this extension?', 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?',
'PURGE_CONFIRM' => 'Are you sure that you wish to purge this extension&#39;s data? This will remove all settings stored for this extension and cannot be undone!', '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_TO_EXTENSION_LIST' => 'Return to the extension list',
'RETURN' => 'Return',
'EXT_DETAILS' => 'Extension Details', 'EXT_DETAILS' => 'Extension Details',
'DISPLAY_NAME' => 'Display Name', 'DISPLAY_NAME' => 'Display Name',