Browse code

Initial commit

Benjamin Roth authored on16/03/2023 20:22:35
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,36 @@
1
+<?php $this->extend('form_row'); ?>
2
+
3
+<?php $this->block('field'); ?>
4
+<fieldset id="ctrl_<?= $this->id ?>" class="radio_container<?php if ($this->class) : ?> <?= $this->class ?><?php endif; ?>">
5
+
6
+  <?php if ($this->label) : ?>
7
+    <legend>
8
+      <?php if ($this->mandatory) : ?>
9
+        <span class="invisible"><?= $this->mandatoryField ?> </span><?= $this->label ?><span class="mandatory">*</span>
10
+      <?php else : ?>
11
+        <?= $this->label ?>
12
+      <?php endif; ?>
13
+    </legend>
14
+  <?php endif; ?>
15
+
16
+  <?php foreach ($this->getOptions() as $option) : ?>
17
+    <?php if ('group_start' == $option['type']) : ?>
18
+      <fieldset>
19
+        <legend><?= $option['label'] ?></legend>
20
+      <?php endif; ?>
21
+
22
+      <?php if ('option' == $option['type']) : ?>
23
+        <div class="form-check"><input type="radio" name="<?= $option['name'] ?>" id="opt_<?= $option['id'] ?>" class="form-check-input radio" value="<?= $option['value'] ?>" <?= $option['checked'] ?><?= $option['attributes'] ?>> <label class="form-check-label" id="lbl_<?= $option['id'] ?>" for="opt_<?= $option['id'] ?>"><?= $option['label'] ?></label></div>
24
+      <?php endif; ?>
25
+
26
+      <?php if ('group_end' == $option['type']) : ?>
27
+      </fieldset>
28
+    <?php endif; ?>
29
+  <?php endforeach; ?>
30
+
31
+  <?php if ($this->hasErrors()) : ?>
32
+    <p class="error"><?= $this->getErrorAsString() ?></p>
33
+  <?php endif; ?>
34
+
35
+</fieldset>
36
+<?php $this->endblock(); ?>
0 37
\ No newline at end of file