1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 16:27:38 +02:00

[ticket/17100] Move html of build_select to templates

PHPBB3-17100
This commit is contained in:
Marc Alexander
2022-04-18 22:33:30 +02:00
parent d91f11d55f
commit b09af35c90
4 changed files with 16 additions and 18 deletions

View File

@@ -209,18 +209,21 @@ function adm_back_link($u_action)
/**
* Build select field options in acp pages
*/
function build_select($option_ary, $option_default = false)
function build_select($option_ary, $option_default = false): array
{
global $user;
global $language;
$html = '';
$options = [];
foreach ($option_ary as $value => $title)
{
$selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : '';
$html .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$title] . '</option>';
$options[] = [
'value' => $value,
'selected' => $option_default !== false && $value == $option_default,
'label' => $language->lang($title),
];
}
return $html;
return $options;
}
/**