[ticket/17100] Remove select html for attachments category select

PHPBB3-17100
This commit is contained in:
Marc Alexander 2022-04-17 22:28:32 +02:00
parent fb1899de62
commit 3e75aabc64
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 18 additions and 7 deletions

View file

@ -175,8 +175,14 @@
<dd><input type="text" id="group_name" size="20" maxlength="100" name="group_name" value="{GROUP_NAME}" /></dd>
</dl>
<dl>
<dt><label for="category">{L_SPECIAL_CATEGORY}{L_COLON}</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt>
<dd>{S_CATEGORY_SELECT}</dd>
<dt><label for="{{ S_CATEGORY_SELECT.id }}">{L_SPECIAL_CATEGORY}{L_COLON}</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt>
<dd>
<select name="{{ S_CATEGORY_SELECT.name }}" id="{{ S_CATEGORY_SELECT.id }}">
{% for option in S_CATEGORY_SELECT.options %}
<option value="{{ option.value }}"{% if option.selected %} selected="selected"{% endif %}>{{ option.label }}</option>
{% endfor %}
</select>
</dd>
</dl>
<dl>
<dt><label for="allowed">{L_ALLOWED}{L_COLON}</label></dt>

View file

@ -1445,16 +1445,21 @@ class acp_attachments
$cat_type = attachment_category::NONE;
}
$group_select = '<select name="' . $select_name . '"' . (($key) ? ' id="' . $key . '"' : '') . '>';
$group_select = [
'name' => $select_name,
'id' => $key,
'options' => [],
];
foreach ($types as $type => $mode)
{
$selected = ($type == $cat_type) ? ' selected="selected"' : '';
$group_select .= '<option value="' . $type . '"' . $selected . '>' . $mode . '</option>';
$group_select['options'][] = [
'value' => $type,
'selected' => $type == $cat_type,
'label' => $mode,
];
}
$group_select .= '</select>';
return $group_select;
}