1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/17151] Fix registration test error

PHPBB3-17151
This commit is contained in:
rxu
2023-09-19 13:16:57 +07:00
parent 9350e82d71
commit 52517a5efd
7 changed files with 54 additions and 22 deletions

View File

@@ -86,8 +86,8 @@ class acp_board
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
'legend2' => 'BOARD_STYLE',
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
'guest_style' => array('lang' => 'GUEST_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array($this->guest_style_get(), false), 'explain' => true),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'method' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
'guest_style' => array('lang' => 'GUEST_STYLE', 'validate' => 'int', 'type' => 'select', 'method' => 'style_select', 'params' => array($this->guest_style_get(), false), 'explain' => true),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'WARNINGS',
@@ -1127,6 +1127,18 @@ class acp_board
return phpbb_language_select($db, $default, $langdata);
}
/**
* Wrapper function for style_select()
*
* @return array
*/
public function style_select(): array
{
global $db;
return ['options' => style_select()];
}
/**
* Board disable option and message
*/

View File

@@ -321,12 +321,15 @@ class acp_bots
unset($bot_row['user_lang'], $bot_row['user_style']);
}
$s_active_options = '';
$s_active_options = [];
$_options = array('0' => 'NO', '1' => 'YES');
foreach ($_options as $value => $lang)
{
$selected = ($bot_row['bot_active'] == $value) ? ' selected="selected"' : '';
$s_active_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$lang] . '</option>';
$s_active_options[] = [
'value' => $value,
'selected' => $bot_row['bot_active'] == $value,
'label' => $user->lang($lang),
];
}
$style_select = style_select($bot_row['bot_style'], true);
@@ -345,14 +348,22 @@ class acp_bots
'BOT_AGENT' => $bot_row['bot_agent'],
'S_EDIT_BOT' => true,
'S_ACTIVE_OPTIONS' => $s_active_options,
'S_STYLE_OPTIONS' => $style_select,
'S_ACTIVE_OPTIONS' => [
'id' => 'bot_active',
'name' => 'bot_active',
'options' => $s_active_options,
],
'S_STYLE_OPTIONS' => [
'id' => 'bot_style',
'name' => 'bot_style',
'options' => $style_select,
],
'LANG_OPTIONS' => [
'id' => 'bot_lang',
'name' => 'bot_lang',
'options' => $lang_options,
],
'S_ERROR' => (count($error)) ? true : false,
'S_ERROR' => (bool) count($error),
));
return;

View File

@@ -1838,7 +1838,11 @@ class acp_users
'name' => 'lang',
'options' => $lang_options,
],
'S_STYLE_OPTIONS' => style_select($data['style']),
'S_STYLE_OPTIONS' => [
'id' => 'style',
'name' => 'style',
'options' => style_select($data['style'])
],
'TIMEZONE_OPTIONS' => [
'tag' => 'select',
'name' => 'tz',