- Settings block (fieldset) can have any content (not only a table with hardcoded structure)
| | |
| | | $out = $form_start; |
| | | |
| | | foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $idx => $block) { |
| | | if ($block['options']) { |
| | | if (!empty($block['options'])) { |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | foreach ($block['options'] as $option) { |
| | |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $table->show($attrib)); |
| | | } |
| | | else if (!empty($block['content'])) { |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $block['content']); |
| | | } |
| | | } |
| | | |
| | | return $out . $form_end; |
| | |
| | | |
| | | // create output |
| | | foreach ($data['blocks'] as $block) { |
| | | if ($block['options']) { |
| | | foreach ($block['options'] as $option) { |
| | | if (!empty($block['content']) || !empty($block['options'])) { |
| | | $found = true; |
| | | break 2; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |