[ticket/17093] Use acp twig macro for display of acp board setting

PHPBB3-17093
This commit is contained in:
Christian Schnegelberger 2024-02-04 15:15:22 +01:00
parent 042feffed8
commit 73806f9342
2 changed files with 23 additions and 4 deletions

View file

@ -1051,11 +1051,30 @@ class acp_board
/**
* Board disable access for which group: admins: 0; plus global moderators: 1 and plus all moderators: 2
*/
function board_disable_access($value, $key = '')
public function board_disable_access($value, $key = '') : array
{
global $user;
return '<option value="0"' . (($value == 0) ? ' selected="selected"' : '') . '>' . $user->lang['DISABLE_BOARD_ACCESS_ADMIN'] . '</option><option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['DISABLE_BOARD_ACCESS_ADMIN_GLOB_MODS'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['DISABLE_BOARD_ACCESS_ADMIN_ALL_MODS'] . '</option>';
return [
[
'tag' => 'select',
'value' => 0,
'selected' => ($value == 0) ? ' selected="selected"' : '',
'label' => $user->lang['DISABLE_BOARD_ACCESS_ADMIN'],
],
[
'tag' => 'select',
'value' => 1,
'selected' => ($value == 1) ? ' selected="selected"' : '',
'label' => $user->lang['DISABLE_BOARD_ACCESS_ADMIN_GLOB_MODS'],
],
[
'tag' => 'select',
'value' => 2,
'selected' => ($value == 2) ? ' selected="selected"' : '',
'label' => $user->lang['DISABLE_BOARD_ACCESS_ADMIN_ALL_MODS'],
]
];
}
/**

View file

@ -11,14 +11,14 @@
*
*/
namespace phpbb\db\migration\data\v33x;
namespace phpbb\db\migration\data\v400;
class add_disable_board_access_config extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return [
'\phpbb\db\migration\data\v33x\v3310',
'\phpbb\db\migration\data\v400\dev',
];
}