1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-05 00:13:29 +02:00

[ticket/15289] Update acp template

PHPBB3-15289
This commit is contained in:
Rubén Calvo 2017-08-03 19:02:07 +02:00
parent 04a34d9f4f
commit 0b75f1e46a
3 changed files with 29 additions and 40 deletions

View File

@ -1,4 +1,3 @@
{% import 'forms.html' as forms %}
<!-- INCLUDE overall_header.html -->
<a id="maincontent"></a>
@ -30,13 +29,35 @@
<fieldset id="{{ storage.get_name }}_{{ provider.get_name }}_settings">
<legend>{{ lang('STORAGE_' ~ storage.get_name | upper ~ '_TITLE') }} - {{ lang('STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_NAME') }}</legend>
{% for name, options in provider.get_options %}
{% set l_name = 'STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_OPTION_' ~ name | upper %}
{% set options = options|merge({'name': storage.get_name ~ '[' ~ name ~ ']'}) %}
{% set options = options|merge({'value': attribute(CONFIG, 'storage\\' ~ storage.get_name ~ '\\config\\' ~ name)}) %}
{{ forms.form_row(
forms.form_label(l_name),
forms.form_control(options)
) }}
<dl>
<dt>
<label for="">{{ lang('STORAGE_ADAPTER_' ~ provider.get_name | upper ~ '_OPTION_' ~ name | upper) }}{{ lang('COLON') }}</label>{% if description is not empty %}<br /><span>{{ lang(description) }}</span>{% endif %}
</dt>
<dd>
{% set input_type = options['type'] %}
{% set input_name = storage.get_name ~ '[' ~ name ~ ']' %}
{% set input_value = attribute(CONFIG, 'storage\\' ~ storage.get_name ~ '\\config\\' ~ name) %}
{% if
input_type == 'text' or
input_type == 'password' or
input_type == 'email' %}
<input id="" type="{{ input_type }}" name="{{ input_name }}" value="{{ input_value }}" maxlength="{{ options['maxlength'] ?: 255 }}" />
{% elseif input_type == 'textarea' %}
<textarea id="" name="{{ input_name }}">{{ input_value }}</textarea>
{% elseif input_type == 'radio' %}
{% for option_name, option_value in options['options'] %}
<label><input type="radio" name="{{ input_name }}" value="{{ option_value }}" class="radio" id=""{{ (option_value == input_value) ? ' checked="checked"' }}>{{ lang(option_name) }}</textarea></label>
{% endfor %}
{% elseif input_type == 'select' %}
<select name="{{ input_name }}">
{% for option_name, option_value in options['options'] %}
<option value="{{ option_value }}"{{ (option_value == input_value) ? ' selected' }}>{{ lang(option_name) }}</option>
{% endfor %}
</select>
{% endif %}
</dd>
</dl>
{% endfor %}
</fieldset>
{% endfor %}

View File

@ -1,28 +0,0 @@
{% macro input(name, value, type, size) %}
<input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
{% endmacro %}
{% macro textarea(name, value, rows, cols) %}
<textarea name="{{ name }}" rows="{{ rows|default(10) }}" cols="{{ cols|default(40) }}">{{ value|e }}</textarea>
{% endmacro %}
{% macro form_control(params) %}
{% if params['type'] == 'text' %}
{{ _self.input(params['name'], params['value'], params['type']) }}
{% endif %}
{% endmacro %}
{% macro form_label(name, description = '') %}
<label for="">{{ lang(name) }}</label>{% if description is not empty %}<br /><span>{{ lang(description) }}</span>{% endif %}
{% endmacro %}
{% macro form_row(left_content, right_content) %}
<dl>
<dt>
{{ left_content }}
</dt>
<dd>
{{ right_content}}
</dd>
</dl>
{% endmacro %}

View File

@ -11,10 +11,6 @@
*
*/
/**
* @todo add cron intervals to server settings? (database_gc, queue_interval, session_gc, search_gc, cache_gc, warnings_gc)
*/
/**
* @ignore
*/