Form: rename 'content_below' to 'buttons_extra'

This commit is contained in:
Aaron van Geffen 2025-09-11 19:59:30 +02:00
parent 094fa16e78
commit be51946436
5 changed files with 7 additions and 7 deletions

View File

@ -122,7 +122,7 @@ class EditAlbum extends HTMLController
$this->form = new Form([
'request_url' => BASEURL . '/editalbum/?' . ($id_tag ? 'id=' . $id_tag : 'add'),
'content_below' => $after_form,
'buttons_extra' => $after_form,
'fields' => $fields,
]);

View File

@ -106,7 +106,7 @@ class EditTag extends HTMLController
$form = new Form([
'request_url' => BASEURL . '/edittag/?' . ($id_tag ? 'id=' . $id_tag : 'add'),
'content_below' => $after_form,
'buttons_extra' => $after_form,
'fields' => $fields,
]);

View File

@ -69,7 +69,7 @@ class EditUser extends HTMLController
$form = new Form([
'request_url' => BASEURL . '/edituser/?' . ($id_user ? 'id=' . $id_user : 'add'),
'content_below' => $after_form,
'buttons_extra' => $after_form,
'fields' => [
'first_name' => [
'type' => 'text',

View File

@ -11,7 +11,7 @@ class Form
public $request_method;
public $request_url;
public $content_above;
public $content_below;
public $buttons_extra;
private $fields = [];
private $data = [];
private $missing = [];
@ -24,7 +24,7 @@ class Form
$this->request_method = !empty($options['request_method']) ? $options['request_method'] : 'POST';
$this->request_url = !empty($options['request_url']) ? $options['request_url'] : BASEURL;
$this->fields = !empty($options['fields']) ? $options['fields'] : [];
$this->content_below = !empty($options['content_below']) ? $options['content_below'] : null;
$this->buttons_extra = !empty($options['buttons_extra']) ? $options['buttons_extra'] : null;
$this->content_above = !empty($options['content_above']) ? $options['content_above'] : null;
$this->submit_caption = !empty($options['submit_caption']) ? $options['submit_caption'] : 'Save information';
$this->trim_inputs = !empty($options['trim_inputs']);

View File

@ -48,9 +48,9 @@ class FormView extends SubTemplate
<div class="offset-sm-2 col-sm-10">
<button type="submit" name="submit" class="btn btn-primary">', $this->form->getSubmitButtonCaption(), '</button>';
if (isset($this->form->content_below))
if (isset($this->form->buttons_extra))
echo '
', $this->form->content_below;
', $this->form->buttons_extra;
echo '
</div>