2018-10-05 21:32:15 -04:00
|
|
|
<?php
|
|
|
|
// Higher scoped variables:
|
|
|
|
// $fields
|
|
|
|
// $hiddenFields
|
|
|
|
// $nestedPrefix
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php foreach ($fields as $name => $field): ?>
|
2020-05-08 19:16:04 -04:00
|
|
|
<?php
|
|
|
|
$fieldName = ($section === 'config' || $nestedPrefix !== 'config')
|
|
|
|
? "{$nestedPrefix}[{$name}]"
|
|
|
|
: "{$nestedPrefix}[{$section}][{$name}]";
|
|
|
|
?>
|
2018-10-05 21:32:15 -04:00
|
|
|
<?php if ($field['type'] === 'subfield'): ?>
|
|
|
|
<section>
|
|
|
|
<h4><?= $field['title'] ?></h4>
|
2020-05-08 19:16:04 -04:00
|
|
|
<?php include '_subfield.php'; ?>
|
2018-10-05 21:32:15 -04:00
|
|
|
</section>
|
|
|
|
<?php elseif ( ! empty($field['display'])): ?>
|
2020-05-08 19:16:04 -04:00
|
|
|
<?php include '_field.php' ?>
|
2018-10-05 21:32:15 -04:00
|
|
|
<?php else: ?>
|
2020-05-08 19:16:04 -04:00
|
|
|
<?php $hiddenFields[] = $helper->field($fieldName, $field); ?>
|
2018-10-05 21:32:15 -04:00
|
|
|
<?php endif ?>
|
|
|
|
<?php endforeach ?>
|