InlineFormView: combine fields and buttons into one 'controls' array

This commit is contained in:
2025-09-23 14:48:08 +02:00
parent 0274ff5bf4
commit 77fa33730a
5 changed files with 11 additions and 18 deletions

View File

@@ -21,26 +21,19 @@ class InlineFormView
echo '
<div class="input-group">';
if (!empty($form['fields']))
foreach ($form['controls'] as $name => $control)
{
foreach ($form['fields'] as $name => $field)
{
if ($field['type'] === 'select')
self::renderSelectBox($field, $name);
else
self::renderInputBox($field, $name);
}
if ($control['type'] === 'select')
self::renderSelectBox($control, $name);
elseif ($control['type'] === 'submit')
self::renderSubmitButton($control, $name);
else
self::renderInputBox($control, $name);
}
echo '
<input type="hidden" name="', Session::getSessionTokenKey(), '" value="', Session::getSessionToken(), '">';
if (!empty($form['buttons']))
foreach ($form['buttons'] as $name => $button)
{
self::renderSubmitButton($button, $name);
}
if (!empty($form['is_group']))
echo '
</div>';