diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html index 1b0b6d46de..19a766fd8c 100644 --- a/phpBB/adm/style/acp_inactive.html +++ b/phpBB/adm/style/acp_inactive.html @@ -65,7 +65,8 @@
- + {% from 'form_macros.twig' import select %} + {{ select(INACTIVE_OPTIONS) }}

{L_MARK_ALL}{L_UNMARK_ALL}

{S_FORM_TOKEN} diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 7b4536f755..02412aa526 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -306,7 +306,10 @@ class acp_inactive $template->assign_vars(array( 'S_INACTIVE_USERS' => true, - 'S_INACTIVE_OPTIONS' => build_select($option_ary), + 'INACTIVE_OPTIONS' => [ + 'name' => 'action', + 'options' => build_select($option_ary), + ], 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 71e9ed7a2e..d99d1995db 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -626,16 +626,7 @@ class acp_main )); } - $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE'); - if ($config['email_enable']) - { - $option_ary += array('remind' => 'REMIND'); - } - - $template->assign_vars(array( - 'S_INACTIVE_USERS' => true, - 'S_INACTIVE_OPTIONS' => build_select($option_ary)) - ); + $template->assign_var('S_INACTIVE_USERS', true); } // Warn if install is still present diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 106ca8bf66..716d9f6d53 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -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 .= ''; + $options[] = [ + 'value' => $value, + 'selected' => $option_default !== false && $value == $option_default, + 'label' => $language->lang($title), + ]; } - return $html; + return $options; } /**