1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17151] Make settings forms use macros

PHPBB3-17151
This commit is contained in:
rxu
2023-09-19 00:32:24 +07:00
parent c6fd14352e
commit 72770937f2
7 changed files with 187 additions and 77 deletions

View File

@@ -291,7 +291,9 @@ function phpbb_language_select(\phpbb\db\driver\driver_interface $db, string $de
];
}
return $lang_options;
return [
'options' => $lang_options
];
}
/**
@@ -319,14 +321,20 @@ function style_select($default = '', $all = false, array $styledata = [])
$db->sql_freeresult($result);
}
$style_options = '';
$style_options = [];
foreach ($styledata as $row)
{
$selected = ($row['style_id'] == $default) ? ' selected="selected"' : '';
$style_options .= '<option value="' . $row['style_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>';
$style_options[] = [
'tag' => 'select',
'value' => $row['style_id'],
'selected' => $row['style_id'] == $default,
'label' => $row['style_name'],
];
}
return $style_options;
return [
'options' => $style_options,
];
}
/**