| @@ 37-63 (lines=27) @@ | ||
| 34 | return $string; |
|
| 35 | } |
|
| 36 | ||
| 37 | public function form_rows(FormView $view, array $data) |
|
| 38 | { |
|
| 39 | $string = ''; |
|
| 40 | foreach ($view as $child) |
|
| 41 | { |
|
| 42 | if ( array_key_exists('start_fieldset', $child->vars) |
|
| 43 | && $child->vars['start_fieldset'] !== null) |
|
| 44 | { |
|
| 45 | $string .= '<fieldset class="fieldset">'; |
|
| 46 | if (!empty($child->vars['start_fieldset']['title'])) |
|
| 47 | { |
|
| 48 | $string .= '<legend>' . $child->vars['start_fieldset']['title'] . '</legend>'; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | $string .= $this->renderer->row($child); |
|
| 52 | if ( array_key_exists('end_fieldset', $child->vars) |
|
| 53 | && $child->vars['end_fieldset'] !== null) |
|
| 54 | { |
|
| 55 | $end_fieldsets = max(1, (int) $child->vars['end_fieldset']); |
|
| 56 | for ($i = 0; $i < $end_fieldsets; $i++) |
|
| 57 | { |
|
| 58 | $string .= '</fieldset>'; |
|
| 59 | } |
|
| 60 | } |
|
| 61 | } |
|
| 62 | return $string; |
|
| 63 | } |
|
| 64 | ||
| 65 | public function form_end(FormView $view, array $data) |
|
| 66 | { |
|
| @@ 23-49 (lines=27) @@ | ||
| 20 | return ''; |
|
| 21 | } |
|
| 22 | ||
| 23 | public function form_rows(FormView $view, array $data) |
|
| 24 | { |
|
| 25 | $string = ''; |
|
| 26 | foreach ($view as $child) |
|
| 27 | { |
|
| 28 | if ( array_key_exists('start_fieldset', $child->vars) |
|
| 29 | && $child->vars['start_fieldset'] !== null) |
|
| 30 | { |
|
| 31 | $string .= '<div class="fieldset">'; |
|
| 32 | if (!empty($child->vars['start_fieldset']['title'])) |
|
| 33 | { |
|
| 34 | $string .= '<h2>' . $child->vars['start_fieldset']['title'] . '</h2>'; |
|
| 35 | } |
|
| 36 | } |
|
| 37 | $string .= $this->renderer->row($child); |
|
| 38 | if ( array_key_exists('end_fieldset', $child->vars) |
|
| 39 | && $child->vars['end_fieldset'] !== null) |
|
| 40 | { |
|
| 41 | $end_fieldsets = max(1, (int) $child->vars['end_fieldset']); |
|
| 42 | for ($i = 0; $i < $end_fieldsets; $i++) |
|
| 43 | { |
|
| 44 | $string .= '</div>'; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | } |
|
| 48 | return $string; |
|
| 49 | } |
|
| 50 | ||
| 51 | public function hidden_row(FormView $view, array $data) |
|
| 52 | { |
|