From d51edb6092363afcdcfe979c8e14f02ee47f3aa8 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 25 Jul 2021 23:47:16 +0200 Subject: [PATCH] Fixed backend pages, shifts table header --- includes/pages/admin_free.php | 6 +++--- includes/sys_form.php | 24 +++++++++++++++++------- includes/view/ShiftsFilterRenderer.php | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index 9008debc..47deb4e6 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -105,9 +105,9 @@ function admin_free() form([ div('row', [ div('col-md-12 form-inline', [ - div('inline-form-spacing', [ - form_text('search', __('Search'), $search), - form_select('angeltype', __('Angeltype'), $angel_types, $angelType), + div('row', [ + form_text('search', __('Search'), $search, null, null, null, 'col'), + form_select('angeltype', __('Angeltype'), $angel_types, $angelType, '', 'col'), form_submit('submit', __('Search')) ]), ]), diff --git a/includes/sys_form.php b/includes/sys_form.php index 4290d8a3..d57e89b4 100644 --- a/includes/sys_form.php +++ b/includes/sys_form.php @@ -257,10 +257,11 @@ function form_submit($name, $label, $class = '', $wrapForm = true, $buttonType = * @param bool $disabled * @param int|null $maxlength * @param string|null $autocomplete + * @param string|null $class * * @return string */ -function form_text($name, $label, $value, $disabled = false, $maxlength = null, $autocomplete = null) +function form_text($name, $label, $value, $disabled = false, $maxlength = null, $autocomplete = null, $class = '') { $disabled = $disabled ? ' disabled="disabled"' : ''; $maxlength = $maxlength ? ' maxlength=' . (int)$maxlength : ''; @@ -270,7 +271,8 @@ function form_text($name, $label, $value, $disabled = false, $maxlength = null, $label, '', - 'form_' . $name + 'form_' . $name, + $class ); } @@ -404,14 +406,16 @@ function form_textarea($name, $label, $value, $disabled = false) * @param string[] $values * @param string $selected * @param string $selectText + * @param string $class * @return string */ -function form_select($name, $label, $values, $selected, $selectText = '') +function form_select($name, $label, $values, $selected, $selectText = '', $class = '') { return form_element( $label, html_select_key('form_' . $name, $name, $values, $selected, $selectText), - 'form_' . $name + 'form_' . $name, + $class ); } @@ -421,15 +425,21 @@ function form_select($name, $label, $values, $selected, $selectText = '') * @param string $label * @param string $input * @param string $for + * @param string $class * @return string */ -function form_element($label, $input, $for = '') +function form_element($label, $input, $for = '', $class = '') { + $class = $class ? ' ' . $class : ''; + if (empty($label)) { - return '
' . $input . '
'; + return '
' . $input . '
'; } - return '
' . '' . $input . '
'; + return '
' + . '' + . $input + . '
'; } /** diff --git a/includes/view/ShiftsFilterRenderer.php b/includes/view/ShiftsFilterRenderer.php index 202298c6..1eb43501 100644 --- a/includes/view/ShiftsFilterRenderer.php +++ b/includes/view/ShiftsFilterRenderer.php @@ -58,7 +58,7 @@ class ShiftsFilterRenderer if ($dashboardFilter) { $toolbar[] = sprintf( - '
  • %s
  • ', + '
  • %s
  • ', url('/public-dashboard', ['filtered' => true] + $dashboardFilter), icon('speedometer2') . __('Dashboard') );