[ticket/11994] Make install/enable just one UI thing

PHPBB3-11994
This commit is contained in:
Joas Schilling 2013-11-02 23:23:48 +01:00
parent 476464374a
commit 7e1a02b3a1
3 changed files with 9 additions and 18 deletions

View file

@ -5,7 +5,7 @@
<h1>{L_EXTENSIONS_ADMIN}</h1> <h1>{L_EXTENSIONS_ADMIN}</h1>
<p>{L_EXTENSIONS_EXPLAIN}</p> <p>{L_EXTENSIONS_EXPLAIN}</p>
<p><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE_EXPLAIN}<!-- ELSE -->{L_EXTENSION_INSTALL_EXPLAIN}<!-- ENDIF --></p> <p>{L_EXTENSION_ENABLE_EXPLAIN}</p>
<!-- IF MIGRATOR_ERROR --> <!-- IF MIGRATOR_ERROR -->
<div class="errorbox"> <div class="errorbox">
@ -20,18 +20,18 @@
<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><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE}<!-- ELSE -->{L_EXTENSION_INSTALL}<!-- ENDIF --></legend> <legend>{L_EXTENSION_ENABLE}</legend>
<input class="button1" type="submit" name="enable" value="<!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE}<!-- ELSE -->{L_EXTENSION_INSTALL}<!-- ENDIF -->" /> <input class="button1" type="submit" name="enable" value="{L_EXTENSION_ENABLE}" />
<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><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE_IN_PROGRESS}<!-- ELSE -->{L_EXTENSION_INSTALL_IN_PROGRESS}<!-- ENDIF --></p> <p>{L_EXTENSION_ENABLE_IN_PROGRESS}</p>
</div> </div>
<!-- ELSE --> <!-- ELSE -->
<div class="successbox"> <div class="successbox">
<p><!-- IF IS_ENABLING -->{L_EXTENSION_ENABLE_SUCCESS}<!-- ELSE -->{L_EXTENSION_INSTALL_SUCCESS}<!-- ENDIF --></p> <p>{L_EXTENSION_ENABLE_SUCCESS}</p>
<br /> <br />
<p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p> <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
</div> </div>

View file

@ -83,7 +83,6 @@ 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);
@ -98,14 +97,12 @@ class acp_extensions
$template->assign_vars(array( $template->assign_vars(array(
'PRE' => true, 'PRE' => true,
'IS_ENABLING' => $action == 'enable_pre', 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')),
'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_' . (($action == 'enable_pre') ? 'ENABLE' : 'INSTALL') . '_CONFIRM', $md_manager->get_metadata('display-name')), 'U_ENABLE' => $this->u_action . '&amp;action=enable&amp;ext_name=' . urlencode($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);
@ -120,7 +117,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=' . $action . '&amp;ext_name=' . urlencode($ext_name)); meta_refresh(0, $this->u_action . '&amp;action=enable&amp;ext_name=' . urlencode($ext_name));
} }
} }
} }
@ -132,7 +129,6 @@ class acp_extensions
$this->tpl_name = 'acp_ext_enable'; $this->tpl_name = 'acp_ext_enable';
$template->assign_vars(array( $template->assign_vars(array(
'IS_ENABLING' => $action == 'enable',
'U_RETURN' => $this->u_action . '&amp;action=list', 'U_RETURN' => $this->u_action . '&amp;action=list',
)); ));
break; break;
@ -309,7 +305,7 @@ class acp_extensions
)); ));
$this->output_actions('disabled', array( $this->output_actions('disabled', array(
'INSTALL' => $this->u_action . '&amp;action=install_pre&amp;ext_name=' . urlencode($name), 'ENABLE' => $this->u_action . '&amp;action=enable_pre&amp;ext_name=' . urlencode($name),
)); ));
} }
catch(\phpbb\extension\exception $e) catch(\phpbb\extension\exception $e)

View file

@ -49,22 +49,18 @@ $lang = array_merge($lang, array(
'EXTENSION_DISABLE' => 'Disable', 'EXTENSION_DISABLE' => 'Disable',
'EXTENSION_ENABLE' => 'Enable', 'EXTENSION_ENABLE' => 'Enable',
'EXTENSION_INSTALL' => 'Install',
'EXTENSION_UNINSTALL' => 'Uninstall', 'EXTENSION_UNINSTALL' => 'Uninstall',
'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', '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_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 of its data and settings. The extension files are retained so it can be installed again.', 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all of its data and settings. The extension files are retained so it can be installed again.',
'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.', 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.',
'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.', 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.',
'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave or refresh this page until it is completed.',
'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being uninstalled, please do not leave or refresh this page until it is completed.', 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being uninstalled, please do not leave or refresh this page until it is completed.',
'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully',
'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled 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_UNINSTALL_SUCCESS' => 'The extension was uninstalled successfully',
'EXTENSION_NAME' => 'Extension Name', 'EXTENSION_NAME' => 'Extension Name',
@ -73,7 +69,6 @@ $lang = array_merge($lang, array(
'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?', '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_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!', '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!',
'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list', 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list',