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

[ticket/17151] Improve radio input type handling

- allow more than 2 buttons count
- allow custom buttons order
- allow custom button labels

Implemented by allowing JSON data format, backward compatibility preserved.

PHPBB3-17151
This commit is contained in:
rxu
2023-09-20 17:36:46 +07:00
parent 7f365855ce
commit 1cbe1d86da
5 changed files with 49 additions and 32 deletions

View File

@@ -151,10 +151,7 @@ class forms extends AbstractExtension
try
{
return $environment->render('macros/forms/radio_buttons.twig', [
'FIRST_BUTTON' => $form_data['buttons'][0],
'FIRST_BUTTON_LABEL' => $form_data['buttons'][0]['label'],
'SECOND_BUTTON' => $form_data['buttons'][1],
'SECOND_BUTTON_LABEL' => $form_data['buttons'][1]['label'],
'BUTTONS' => $form_data['buttons'],
]);
}
catch (\Twig\Error\Error $e)