34 lines
823 B
PHTML
34 lines
823 B
PHTML
|
<?php
|
||
|
$id = uniqid();
|
||
|
$name = $this->context->name;
|
||
|
$label = isset($this->context->label) ? $this->context->label . ':' : '';
|
||
|
$optionValues = $this->context->optionValues;
|
||
|
$optionLabels = $this->context->optionLabels;
|
||
|
$activeOptionValue = $this->context->activeOptionValue;
|
||
|
$keys = array_keys($optionValues);
|
||
|
?>
|
||
|
|
||
|
<div class="form-row">
|
||
|
<label for="<?= $id ?>">
|
||
|
<?= $label ?>
|
||
|
</label>
|
||
|
<div class="input-wrapper">
|
||
|
|
||
|
<?php foreach ($keys as $key): ?>
|
||
|
<label>
|
||
|
<input type="radio"
|
||
|
name="<?= $name ?>"
|
||
|
<?php if (count($keys) == 1): ?>
|
||
|
id="<?= $id ?>"
|
||
|
<?php endif ?>
|
||
|
<?php if ($optionValues[$key] == $activeOptionValue): ?>
|
||
|
checked="checked"
|
||
|
<?php endif ?>
|
||
|
value="<?= $optionValues[$key] ?>"/>
|
||
|
|
||
|
<?= $optionLabels[$key] ?>
|
||
|
</label>
|
||
|
<?php endforeach ?>
|
||
|
</div>
|
||
|
</div>
|