mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
Merge pull request #6541 from Crizz0/ticket/17093-master
[ticket/17093] Add ACP setting to limit access to disabled board
This commit is contained in:
@@ -79,6 +79,7 @@ class acp_board
|
||||
'board_index_text' => array('lang' => 'BOARD_INDEX_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true),
|
||||
'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
|
||||
'board_disable_msg' => false,
|
||||
'board_disable_access' => array('lang' => 'DISABLE_BOARD_ACCESS', 'validate' => 'int', 'type' => 'select', 'method' => 'board_disable_access', 'explain' => true),
|
||||
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'method' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
|
||||
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
|
||||
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
|
||||
@@ -1047,6 +1048,34 @@ class acp_board
|
||||
return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />';
|
||||
}
|
||||
|
||||
/**
|
||||
* Board disable access for which group: admins: 0; plus global moderators: 1 and plus all moderators: 2
|
||||
*
|
||||
* @param int $value Value from config
|
||||
*
|
||||
* @return array Options array for select
|
||||
*/
|
||||
public function board_disable_access(int $value) : array
|
||||
{
|
||||
return [
|
||||
[
|
||||
'value' => 0,
|
||||
'selected' => $value == 0,
|
||||
'label' => $this->language->lang('DISABLE_BOARD_ACCESS_ADMIN'),
|
||||
],
|
||||
[
|
||||
'value' => 1,
|
||||
'selected' => $value == 1,
|
||||
'label' => $this->language->lang('DISABLE_BOARD_ACCESS_ADMIN_GLOB_MODS'),
|
||||
],
|
||||
[
|
||||
'value' => 2,
|
||||
'selected' => $value == 2,
|
||||
'label' => $this->language->lang('DISABLE_BOARD_ACCESS_ADMIN_ALL_MODS'),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Global quick reply enable/disable setting and button to enable in all forums
|
||||
*/
|
||||
|
Reference in New Issue
Block a user