[ticket/11366] Add $config['extension_force_unstable']

PHPBB3-11366
This commit is contained in:
Tristan Darricau 2014-05-12 17:23:50 +02:00
parent f4d598559f
commit 8dc10d6971
4 changed files with 81 additions and 2 deletions

View file

@ -6,6 +6,27 @@
<p>{L_EXTENSIONS_EXPLAIN}</p>
<form id="version_check_settings" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_EXTENSIONS_VERSION_CHECK_SETTINGS}</legend>
<dl>
<dt><label for="force_unstable">{L_FORCE_UNSTABLE}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="force_unstable" class="radio" value="1"<!-- IF FORCE_UNSTABLE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="force_unstable" class="radio" value="0"<!-- IF not FORCE_UNSTABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<p class="submit-buttons">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" name="reset" value="{L_RESET}" />
<input type="hidden" name="action" value="set_config_version_check_force_unstable" />
{S_FORM_TOKEN}
</p>
</fieldset>
</form>
<table class="table1">
<col class="row1" ><col class="row1" ><col class="row2" ><col class="row2" >
<thead>

View file

@ -85,13 +85,43 @@ class acp_extensions
// What are we doing?
switch ($action)
{
case 'set_config_version_check_force_unstable':
$force_unstable = $this->request->variable('force_unstable', false);
if ($force_unstable)
{
$s_hidden_fields = build_hidden_fields(array(
'force_unstable' => $force_unstable,
));
confirm_box(false, $user->lang('EXTENSION_FORCE_UNSTABLE_CONFIRM'), $s_hidden_fields);
}
else
{
$config->set('extension_force_unstable', false);
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
break;
case 'list':
default:
if (confirm_box(true))
{
$config->set('extension_force_unstable', true);
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
$this->list_enabled_exts($phpbb_extension_manager);
$this->list_disabled_exts($phpbb_extension_manager);
$this->list_available_exts($phpbb_extension_manager);
$this->template->assign_var('U_VERSIONCHECK_FORCE', $this->u_action . '&amp;action=list&amp;versioncheck_force=1');
$this->template->assign_vars(array(
'U_VERSIONCHECK_FORCE' => $this->u_action . '&amp;action=list&amp;versioncheck_force=1',
'FORCE_UNSTABLE' => $config['extension_force_unstable'],
'U_ACTION' => $this->u_action,
));
add_form_key('version_check_settings');
$this->tpl_name = 'acp_ext_list';
break;

View file

@ -84,6 +84,7 @@ $lang = array_merge($lang, array(
'EXTENSION_DELETE_DATA_CONFIRM' => 'Are you sure that you wish to delete the data associated with “%s”?<br /><br />This removes all of its data and settings 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_FORCE_UNSTABLE_CONFIRM' => 'Are you sure that you wish to force the use of unstable version?',
'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list',
@ -113,5 +114,7 @@ $lang = array_merge($lang, array(
'DOWNLOAD_LATEST' => 'Download Version',
'NO_VERSIONCHECK' => 'No version check information given.',
'VERSIONCHECK_FORCE_UPDATE_ALL' => 'Re-Check all',
'VERSIONCHECK_FORCE_UPDATE_ALL' => 'Re-Check all',
'FORCE_UNSTABLE' => 'Always check for unstable versions',
'EXTENSIONS_VERSION_CHECK_SETTINGS' => 'Version check settings',
));

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace phpbb\db\migration\data\v310;
class extensions_version_check_force_unstable extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array('\phpbb\db\migration\data\v310\dev');
}
public function update_data()
{
return array(
array('config.add', array('extension_force_unstable', false)),
);
}
}