mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-21 08:00:46 +01:00
Merge branch '3.3.x'
This commit is contained in:
commit
6a934a21a5
@ -1,7 +0,0 @@
|
||||
{% for action in enabled.actions %}
|
||||
<a href="{{ action.U_ACTION }}"{% if action.L_ACTION_EXPLAIN %} title="{{ action.L_ACTION_EXPLAIN }}"{% endif %}{% if action.COLOR %} style="color: {{ action.COLOR }};"{% endif %} data-ajax="{{ action.ACTION_AJAX }}" data-refresh="true">{{ action.L_ACTION }}</a>{% if not action.S_LAST_ROW %} | {% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for action in disabled.actions %}
|
||||
<a href="{{ action.U_ACTION }}"{% if action.L_ACTION_EXPLAIN %} title="{{ action.L_ACTION_EXPLAIN }}"{% endif %}{% if action.COLOR %} style="color: {{ action.COLOR }};"{% endif %} data-ajax="{{ action.ACTION_AJAX }}" data-refresh="true">{{ action.L_ACTION }}</a>{% if not action.S_LAST_ROW %} | {% endif %}
|
||||
{% endfor %}
|
40
phpBB/adm/style/acp_ext_delete_data.html
Normal file
40
phpBB/adm/style/acp_ext_delete_data.html
Normal file
@ -0,0 +1,40 @@
|
||||
{% INCLUDE 'overall_header.html' %}
|
||||
|
||||
<a id="maincontent"></a>
|
||||
|
||||
<h1>{{ lang('EXTENSIONS_ADMIN') }}</h1>
|
||||
|
||||
<p>{{ lang('EXTENSIONS_EXPLAIN') }}</p>
|
||||
<p>{{ lang('EXTENSION_DELETE_DATA_EXPLAIN') }}</p>
|
||||
|
||||
{% if MIGRATOR_ERROR %}
|
||||
<div class="errorbox">
|
||||
<p><strong>{{ lang('MIGRATION_EXCEPTION_ERROR') }}</strong></p>
|
||||
<p>{{ MIGRATOR_ERROR }}</p>
|
||||
<p><a href="{{ U_RETURN }}">{{ lang('RETURN_TO_EXTENSION_LIST') }}</a></p>
|
||||
</div>
|
||||
{% elseif S_PRE_STEP %}
|
||||
<div class="errorbox">
|
||||
<p>{{ CONFIRM_MESSAGE }}</p>
|
||||
</div>
|
||||
|
||||
<form id="acp_extensions" method="post" action="{{ U_PURGE }}">
|
||||
<fieldset class="submit-buttons">
|
||||
<legend>{{ lang('EXTENSION_DELETE_DATA') }}</legend>
|
||||
<input class="button1" type="submit" name="delete_data" value="{{ lang('EXTENSION_DELETE_DATA') }}">
|
||||
<input class="button2" type="submit" name="cancel" value="{{ lang('CANCEL') }}">
|
||||
</fieldset>
|
||||
</form>
|
||||
{% elseif S_NEXT_STEP %}
|
||||
<div class="errorbox">
|
||||
<p>{{ lang('EXTENSION_DELETE_DATA_IN_PROGRESS') }}</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="successbox">
|
||||
<p>{{ lang('EXTENSION_DELETE_DATA_SUCCESS') }}</p>
|
||||
<br>
|
||||
<p><a href="{{ U_RETURN }}">{{ lang('RETURN_TO_EXTENSION_LIST') }}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% INCLUDE 'overall_footer.html' %}
|
34
phpBB/adm/style/acp_ext_disable.html
Normal file
34
phpBB/adm/style/acp_ext_disable.html
Normal file
@ -0,0 +1,34 @@
|
||||
{% INCLUDE 'overall_header.html' %}
|
||||
|
||||
<a id="maincontent"></a>
|
||||
|
||||
<h1>{{ lang('EXTENSIONS_ADMIN') }}</h1>
|
||||
|
||||
<p>{{ lang('EXTENSIONS_EXPLAIN') }}</p>
|
||||
<p>{{ lang('EXTENSION_DISABLE_EXPLAIN') }}</p>
|
||||
|
||||
{% if S_PRE_STEP %}
|
||||
<fieldset>
|
||||
<h2>{{ lang('CONFIRM') }}</h2>
|
||||
<p>{{ CONFIRM_MESSAGE }}</p>
|
||||
</fieldset>
|
||||
|
||||
<form id="acp_extensions" method="post" action="{{ U_DISABLE }}">
|
||||
<fieldset class="submit-buttons">
|
||||
<input class="button1" type="submit" name="disable" value="{{ lang('EXTENSION_DISABLE') }}">
|
||||
<input class="button2" type="submit" name="cancel" value="{{ lang('CANCEL') }}">
|
||||
</fieldset>
|
||||
</form>
|
||||
{% elseif S_NEXT_STEP %}
|
||||
<div class="successbox notice">
|
||||
<p>{{ lang('EXTENSION_DISABLE_IN_PROGRESS') }}</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="successbox">
|
||||
<p>{{ lang('EXTENSION_DISABLE_SUCCESS') }}</p>
|
||||
<br>
|
||||
<p><a href="{{ U_RETURN }}">{{ lang('RETURN_TO_EXTENSION_LIST') }}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% INCLUDE 'overall_footer.html' %}
|
40
phpBB/adm/style/acp_ext_enable.html
Normal file
40
phpBB/adm/style/acp_ext_enable.html
Normal file
@ -0,0 +1,40 @@
|
||||
{% INCLUDE 'overall_header.html' %}
|
||||
|
||||
<a id="maincontent"></a>
|
||||
|
||||
<h1>{{ lang('EXTENSIONS_ADMIN') }}</h1>
|
||||
|
||||
<p>{{ lang('EXTENSIONS_EXPLAIN') }}</p>
|
||||
<p>{{ lang('EXTENSION_ENABLE_EXPLAIN') }}</p>
|
||||
|
||||
{% if MIGRATOR_ERROR %}
|
||||
<div class="errorbox">
|
||||
<p><strong>{{ lang('MIGRATION_EXCEPTION_ERROR') }}</strong></p>
|
||||
<p>{{ MIGRATOR_ERROR }}</p>
|
||||
<p><a href="{{ U_RETURN }}">{{ lang('RETURN_TO_EXTENSION_LIST') }}</a></p>
|
||||
</div>
|
||||
{% elseif S_PRE_STEP %}
|
||||
<fieldset>
|
||||
<h2>{{ lang('CONFIRM') }}</h2>
|
||||
<p>{{ CONFIRM_MESSAGE }}</p>
|
||||
</fieldset>
|
||||
|
||||
<form id="acp_extensions" method="post" action="{{ U_ENABLE }}">
|
||||
<fieldset class="submit-buttons">
|
||||
<input class="button1" type="submit" name="enable" value="{{ lang('EXTENSION_ENABLE') }}">
|
||||
<input class="button2" type="submit" name="cancel" value="{{ lang('CANCEL') }}">
|
||||
</fieldset>
|
||||
</form>
|
||||
{% elseif S_NEXT_STEP %}
|
||||
<div class="successbox notice">
|
||||
<p>{{ lang('EXTENSION_ENABLE_IN_PROGRESS') }}</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="successbox">
|
||||
<p>{{ lang('EXTENSION_ENABLE_SUCCESS') }}</p>
|
||||
<br>
|
||||
<p><a href="{{ U_RETURN }}">{{ lang('RETURN_TO_EXTENSION_LIST') }}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% INCLUDE 'overall_footer.html' %}
|
@ -42,8 +42,8 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr id="ext_enabled_header"<!-- IF not .enabled --> class="hidden"<!-- ENDIF -->>
|
||||
<!-- IF .enabled -->
|
||||
<tr>
|
||||
<td class="row3" colspan="4"><strong>{L_EXTENSIONS_ENABLED}</strong><!-- EVENT acp_ext_list_enabled_title_after --></td>
|
||||
</tr>
|
||||
<!-- BEGIN enabled -->
|
||||
@ -59,12 +59,17 @@
|
||||
</td>
|
||||
<td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td>
|
||||
<td style="text-align: center;">
|
||||
<!-- INCLUDE acp_ext_actions.html -->
|
||||
<!-- BEGIN actions -->
|
||||
<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 --> | <!-- ENDIF -->
|
||||
<!-- END actions -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END enabled -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<tr id="ext_disabled_header"<!-- IF not .disabled --> class="hidden"<!-- ENDIF -->>
|
||||
<!-- IF .disabled -->
|
||||
<tr>
|
||||
<td class="row3" colspan="4"><strong>{L_EXTENSIONS_DISABLED}</strong><!-- EVENT acp_ext_list_disabled_title_after --></td>
|
||||
</tr>
|
||||
<!-- BEGIN disabled -->
|
||||
@ -82,10 +87,14 @@
|
||||
<!-- IF disabled.U_DETAILS --><a href="{disabled.U_DETAILS}">{L_DETAILS}</a><!-- ENDIF -->
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<!-- INCLUDE acp_ext_actions.html -->
|
||||
<!-- BEGIN actions -->
|
||||
<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 --> | <!-- ENDIF -->
|
||||
<!-- END actions -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END disabled -->
|
||||
<!-- ENDIF -->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -230,64 +230,6 @@ function parse_document(container)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Extension actions helper functions
|
||||
*/
|
||||
function move_to_enabled(element)
|
||||
{
|
||||
var disabled_header = document.querySelector('#ext_disabled_header');
|
||||
disabled_header.parentNode.insertBefore(element, disabled_header);
|
||||
element.classList.remove('ext_disabled');
|
||||
element.classList.add('ext_enabled');
|
||||
}
|
||||
function move_to_disabled(element)
|
||||
{
|
||||
var table_body = document.querySelector('#ext_disabled_header').parentNode;
|
||||
table_body.appendChild(element);
|
||||
element.classList.remove('ext_enabled');
|
||||
element.classList.add('ext_disabled');
|
||||
}
|
||||
function set_actions(container, actions) {
|
||||
container.innerHTML = '';
|
||||
for (var i = 0; i < actions.length; i++) {
|
||||
var a = document.createElement('a');
|
||||
a.href = actions[i].U_ACTION.split('&').join('&'); // replace all occurances
|
||||
a.title = actions[i].L_ACTION_EXPLAIN;
|
||||
if (actions[i].COLOR) {
|
||||
a.style = actions[i].COLOR;
|
||||
}
|
||||
a.innerHTML = actions[i].L_ACTION;
|
||||
// ajaxify this action as well
|
||||
phpbb.ajaxify({
|
||||
selector: a,
|
||||
refresh: true,
|
||||
callback: actions[i].ACTION_AJAX
|
||||
});
|
||||
|
||||
container.appendChild(a);
|
||||
|
||||
if (i < actions.length - 1) {
|
||||
container.innerHTML += ' | ';
|
||||
}
|
||||
}
|
||||
}
|
||||
function show_enabled_header() {
|
||||
document.querySelector('#ext_enabled_header').classList.remove('hidden');
|
||||
}
|
||||
function show_disabled_header() {
|
||||
document.querySelector('#ext_disabled_header').classList.remove('hidden');
|
||||
}
|
||||
function hide_disabled_header_if_empty() {
|
||||
if (!document.querySelector('.ext_disabled')) {
|
||||
document.querySelector('#ext_disabled_header').classList.add('hidden');
|
||||
}
|
||||
}
|
||||
function hide_enabled_header_if_empty() {
|
||||
if (!document.querySelector('.ext_enabled')) {
|
||||
document.querySelector('#ext_enabled_header').classList.add('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run onload functions
|
||||
*/
|
||||
|
@ -157,34 +157,6 @@ phpbb.addAjaxCallback('row_delete', function(res) {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Callbacks for extension actions
|
||||
*/
|
||||
phpbb.addAjaxCallback('ext_enable', function(res) {
|
||||
if (res.EXT_ENABLE_SUCCESS) {
|
||||
move_to_enabled(this.parentNode.parentNode);
|
||||
set_actions(this.parentNode, res.ACTIONS);
|
||||
show_enabled_header();
|
||||
hide_disabled_header_if_empty();
|
||||
}
|
||||
});
|
||||
phpbb.addAjaxCallback('ext_delete_data', function(res) {
|
||||
if (res.EXT_DELETE_DATA_SUCCESS) {
|
||||
move_to_disabled(this.parentNode.parentNode);
|
||||
set_actions(this.parentNode, res.ACTIONS);
|
||||
show_disabled_header();
|
||||
hide_enabled_header_if_empty();
|
||||
}
|
||||
});
|
||||
phpbb.addAjaxCallback('ext_disable', function(res) {
|
||||
if (res.EXT_DISABLE_SUCCESS) {
|
||||
move_to_disabled(this.parentNode.parentNode);
|
||||
set_actions(this.parentNode, res.ACTIONS);
|
||||
show_disabled_header();
|
||||
hide_enabled_header_if_empty();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Handler for submitting permissions form in chunks
|
||||
* This call will submit permissions forms in chunks of 5 fieldsets.
|
||||
|
@ -191,6 +191,8 @@ class acp_extensions
|
||||
$this->list_disabled_exts($phpbb_extension_manager, $managed_packages);
|
||||
$this->list_available_exts($phpbb_extension_manager, $managed_packages);
|
||||
|
||||
$this->tpl_name = 'acp_ext_list';
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=list&versioncheck_force=1',
|
||||
'FORCE_UNSTABLE' => $this->config['extension_force_unstable'],
|
||||
@ -198,9 +200,8 @@ class acp_extensions
|
||||
'MANAGED_EXTENSIONS' => $managed_packages,
|
||||
'U_CATALOG_ACTION' => $this->u_catalog_action,
|
||||
));
|
||||
$this->request->disable_super_globals();
|
||||
|
||||
$this->tpl_name = 'acp_ext_list';
|
||||
$this->request->disable_super_globals();
|
||||
break;
|
||||
|
||||
case 'enable_pre':
|
||||
@ -223,19 +224,13 @@ class acp_extensions
|
||||
redirect($this->u_action);
|
||||
}
|
||||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
redirect($this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'action' => 'enable_pre',
|
||||
'ext_name' => $ext_name,
|
||||
)));
|
||||
}
|
||||
$this->tpl_name = 'acp_ext_enable';
|
||||
|
||||
$this->template->assign_vars([
|
||||
'S_PRE_STEP' => true,
|
||||
'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')),
|
||||
'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name),
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'enable':
|
||||
@ -260,8 +255,9 @@ class acp_extensions
|
||||
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
|
||||
if ((time() - $start_time) >= $safe_time_limit)
|
||||
{
|
||||
$this->template->assign_var('S_NEXT_STEP', true);
|
||||
|
||||
meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name));
|
||||
trigger_error('EXTENSION_ENABLE_IN_PROGRESS', E_USER_NOTICE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,29 +273,14 @@ class acp_extensions
|
||||
}
|
||||
catch (\phpbb\db\migration\exception $e)
|
||||
{
|
||||
trigger_error($this->user->lang('MIGRATION_EXCEPTION_ERROR', $e->getLocalisedMessage($this->user)), E_USER_WARNING);
|
||||
$this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
|
||||
}
|
||||
|
||||
if ($this->request->is_ajax())
|
||||
{
|
||||
$actions = $this->output_actions('enabled', [
|
||||
'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($ext_name),
|
||||
]);
|
||||
$this->tpl_name = 'acp_ext_enable';
|
||||
|
||||
$data = [
|
||||
'EXT_ENABLE_SUCCESS' => true,
|
||||
'ACTIONS' => $actions,
|
||||
'REFRESH_DATA' => [
|
||||
'url' => '',
|
||||
'time' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
trigger_error($this->user->lang('EXTENSION_ENABLE_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE);
|
||||
$this->template->assign_vars([
|
||||
'U_RETURN' => $this->u_action . '&action=list',
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'disable_pre':
|
||||
@ -308,19 +289,13 @@ class acp_extensions
|
||||
redirect($this->u_action);
|
||||
}
|
||||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
redirect($this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'action' => 'disable_pre',
|
||||
'ext_name' => $ext_name,
|
||||
)));
|
||||
}
|
||||
$this->tpl_name = 'acp_ext_disable';
|
||||
|
||||
$this->template->assign_vars([
|
||||
'S_PRE_STEP' => true,
|
||||
'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')),
|
||||
'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name),
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'disable':
|
||||
@ -337,32 +312,15 @@ class acp_extensions
|
||||
$this->template->assign_var('S_NEXT_STEP', true);
|
||||
|
||||
meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name));
|
||||
trigger_error('EXTENSION_DISABLE_IN_PROGRESS', E_USER_NOTICE);
|
||||
}
|
||||
}
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name));
|
||||
|
||||
if ($this->request->is_ajax())
|
||||
{
|
||||
$actions = $this->output_actions('disabled', [
|
||||
'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($ext_name),
|
||||
'DELETE_DATA' => $this->u_action . '&action=delete_data_pre&ext_name=' . urlencode($ext_name),
|
||||
]);
|
||||
$this->tpl_name = 'acp_ext_disable';
|
||||
|
||||
$data = [
|
||||
'EXT_DISABLE_SUCCESS' => true,
|
||||
'ACTIONS' => $actions,
|
||||
'REFRESH_DATA' => [
|
||||
'url' => '',
|
||||
'time' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
trigger_error($this->user->lang('EXTENSION_DISABLE_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE);
|
||||
$this->template->assign_vars([
|
||||
'U_RETURN' => $this->u_action . '&action=list',
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'delete_data_pre':
|
||||
@ -371,19 +329,13 @@ class acp_extensions
|
||||
redirect($this->u_action);
|
||||
}
|
||||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
redirect($this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'action' => 'delete_data_pre',
|
||||
'ext_name' => $ext_name,
|
||||
)));
|
||||
}
|
||||
$this->tpl_name = 'acp_ext_delete_data';
|
||||
|
||||
$this->template->assign_vars([
|
||||
'S_PRE_STEP' => true,
|
||||
'CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')),
|
||||
'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name),
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'delete_data':
|
||||
@ -402,36 +354,20 @@ class acp_extensions
|
||||
$this->template->assign_var('S_NEXT_STEP', true);
|
||||
|
||||
meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name));
|
||||
trigger_error('EXTENSION_DELETE_DATA_IN_PROGRESS', E_USER_NOTICE);
|
||||
}
|
||||
}
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_PURGE', time(), array($ext_name));
|
||||
}
|
||||
catch (\phpbb\db\migration\exception $e)
|
||||
{
|
||||
trigger_error($this->user->lang('MIGRATION_EXCEPTION_ERROR', $e->getLocalisedMessage($this->user)), E_USER_WARNING);
|
||||
$this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
|
||||
}
|
||||
|
||||
if ($this->request->is_ajax())
|
||||
{
|
||||
$actions = $this->output_actions('disabled', [
|
||||
'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($ext_name),
|
||||
]);
|
||||
$this->tpl_name = 'acp_ext_delete_data';
|
||||
|
||||
$data = [
|
||||
'EXT_DELETE_DATA_SUCCESS' => true,
|
||||
'ACTIONS' => $actions,
|
||||
'REFRESH_DATA' => [
|
||||
'url' => '',
|
||||
'time' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
trigger_error($this->user->lang('EXTENSION_DELETE_DATA_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE);
|
||||
$this->template->assign_vars([
|
||||
'U_RETURN' => $this->u_action . '&action=list',
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'details':
|
||||
@ -1070,37 +1006,17 @@ class acp_extensions
|
||||
*
|
||||
* @param string $block
|
||||
* @param array $actions
|
||||
* @return array List of actions to be performed on the extension
|
||||
*/
|
||||
private function output_actions($block, $actions)
|
||||
{
|
||||
$vars_ary = array();
|
||||
foreach ($actions as $lang => $options)
|
||||
foreach ($actions as $lang => $url)
|
||||
{
|
||||
$url = $options;
|
||||
if (is_array($options))
|
||||
{
|
||||
$url = $options['url'];
|
||||
}
|
||||
|
||||
$vars = array(
|
||||
$this->template->assign_block_vars($block . '.actions', [
|
||||
'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,
|
||||
'ACTION_AJAX' => 'ext_' . strtolower($lang),
|
||||
);
|
||||
|
||||
if (isset($options['color']))
|
||||
{
|
||||
$vars['COLOR'] = $options['color'];
|
||||
}
|
||||
|
||||
$this->template->assign_block_vars($block . '.actions', $vars);
|
||||
|
||||
$vars_ary[] = $vars;
|
||||
]);
|
||||
}
|
||||
|
||||
return $vars_ary;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ $lang = array_merge($lang, array(
|
||||
'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds',
|
||||
'MIGRATION_DATA_RUNNING' => 'Installing Data: %s.',
|
||||
'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s',
|
||||
'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors:<br><br>%s',
|
||||
'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.',
|
||||
'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".',
|
||||
'MIGRATION_NOT_INSTALLED' => 'The migration "%s" is not installed.',
|
||||
'MIGRATION_NOT_VALID' => '%s is not a valid migration.',
|
||||
|
@ -200,7 +200,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||
$this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
|
||||
$this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('#main')->text());
|
||||
$this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text());
|
||||
}
|
||||
|
||||
public function test_actions()
|
||||
@ -211,7 +211,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||
|
||||
// Correctly submit the enable form
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton('confirm')->form();
|
||||
$form = $crawler->selectButton('enable')->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('.successbox')->text());
|
||||
|
||||
@ -221,7 +221,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||
|
||||
// Correctly submit the disable form
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton('confirm')->form();
|
||||
$form = $crawler->selectButton('disable')->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('.successbox')->text());
|
||||
|
||||
@ -231,7 +231,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||
|
||||
// Correctly submit the delete data form
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton('confirm')->form();
|
||||
$form = $crawler->selectButton('delete_data')->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('.successbox')->text());
|
||||
|
||||
|
@ -418,17 +418,18 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
|
||||
public function install_ext($extension)
|
||||
{
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
|
||||
$ext_path = str_replace('/', '%2F', $extension);
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
|
||||
$this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count());
|
||||
$this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count());
|
||||
|
||||
$form = $crawler->selectButton('confirm')->form();
|
||||
$form = $crawler->selectButton($this->lang('EXTENSION_ENABLE'))->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
|
||||
|
||||
@ -448,17 +449,18 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
|
||||
public function disable_ext($extension)
|
||||
{
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
|
||||
$ext_path = str_replace('/', '%2F', $extension);
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
|
||||
$this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count());
|
||||
$this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count());
|
||||
|
||||
$form = $crawler->selectButton('confirm')->form();
|
||||
$form = $crawler->selectButton($this->lang('EXTENSION_DISABLE'))->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
|
||||
|
||||
@ -478,17 +480,18 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
|
||||
public function delete_ext_data($extension)
|
||||
{
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
|
||||
$ext_path = str_replace('/', '%2F', $extension);
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
|
||||
$this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count());
|
||||
$this->assertGreaterThan(1, $crawler->filter('div.main fieldset.submit-buttons input')->count());
|
||||
|
||||
$form = $crawler->selectButton('confirm')->form();
|
||||
$form = $crawler->selectButton($this->lang('EXTENSION_DELETE_DATA'))->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
|
||||
|
||||
|
@ -333,16 +333,17 @@ class phpbb_ui_test_case extends phpbb_test_case
|
||||
|
||||
public function install_ext($extension)
|
||||
{
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
|
||||
$ext_path = str_replace('/', '%2F', $extension);
|
||||
|
||||
$this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
|
||||
$this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2')));
|
||||
$this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2')));
|
||||
|
||||
$this->find_element('cssSelector', "input[value='Yes']")->submit();
|
||||
$this->add_lang('acp/extensions');
|
||||
$this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_ENABLE') . "']")->submit();
|
||||
|
||||
try
|
||||
{
|
||||
@ -368,16 +369,17 @@ class phpbb_ui_test_case extends phpbb_test_case
|
||||
|
||||
public function disable_ext($extension)
|
||||
{
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
|
||||
$ext_path = str_replace('/', '%2F', $extension);
|
||||
|
||||
$this->visit('adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
|
||||
$this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2')));
|
||||
$this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2')));
|
||||
|
||||
$this->find_element('cssSelector', "input[value='Yes']")->submit();
|
||||
$this->add_lang('acp/extensions');
|
||||
$this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_DISABLE') . "']")->submit();
|
||||
|
||||
try
|
||||
{
|
||||
@ -403,16 +405,17 @@ class phpbb_ui_test_case extends phpbb_test_case
|
||||
|
||||
public function delete_ext_data($extension)
|
||||
{
|
||||
$this->add_lang('acp/extensions');
|
||||
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
|
||||
$ext_path = str_replace('/', '%2F', $extension);
|
||||
|
||||
$this->visit('adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
|
||||
$this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2')));
|
||||
$this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset.submit-buttons input.button2')));
|
||||
|
||||
$this->find_element('cssSelector', "input[value='Yes']")->submit();
|
||||
$this->add_lang('acp/extensions');
|
||||
$this->find_element('cssSelector', "input[value='" . $this->lang('EXTENSION_DELETE_DATA') . "']")->submit();
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user