1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2020-05-04 22:34:09 +02:00
12 changed files with 200 additions and 248 deletions

View File

@@ -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 %}&nbsp;|&nbsp;{% 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 %}&nbsp;|&nbsp;{% endif %}
{% endfor %}

View 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' %}

View 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' %}

View 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' %}

View File

@@ -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 -->&nbsp;|&nbsp;<!-- 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 -->&nbsp;|&nbsp;<!-- ENDIF -->
<!-- END actions -->
</td>
</tr>
<!-- END disabled -->
<!-- ENDIF -->
</tbody>
</table>

View File

@@ -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('&amp;').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 += '&nbsp;|&nbsp;';
}
}
}
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
*/

View File

@@ -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.