44 lines
1.1 KiB
PHTML
44 lines
1.1 KiB
PHTML
<?php if (!empty($this->context->options)): ?>
|
|
<div class="unit options">
|
|
<h1>options</h1>
|
|
|
|
<ul>
|
|
<?php foreach ($this->context->options as $option): ?>
|
|
<li class="<?= $option['class']; if (isset($option['inactive'])) echo ' inactive' ?>">
|
|
<?php
|
|
$class = [];
|
|
|
|
$attrs = [];
|
|
if (!empty($option['link']))
|
|
{
|
|
$attrs['href'] = $option['link'];
|
|
}
|
|
elseif (!empty($option['simple-action']))
|
|
{
|
|
$attrs['href'] = $option['simple-action'];
|
|
$class []= 'simple-action';
|
|
|
|
if (isset($option['data-confirm-text']))
|
|
{
|
|
$attrs['data-confirm-text'] = $option['data-confirm-text'];
|
|
$class []= 'confirmable';
|
|
}
|
|
|
|
if (isset($option['data-redirect-url']))
|
|
$attrs['data-redirect-url'] = $option['data-redirect-url'];
|
|
}
|
|
else
|
|
$attrs['href'] = '#';
|
|
|
|
if (!empty($class))
|
|
$attrs['class'] = join(' ', $class);
|
|
|
|
echo TextHelper::htmlTag('a', TextHelper::HTML_OPEN, $attrs);
|
|
echo $option['text'];
|
|
echo TextHelper::htmlTag('a', TextHelper::HTML_CLOSE);
|
|
?>
|
|
</li>
|
|
<?php endforeach ?>
|
|
</ul>
|
|
</div>
|
|
<?php endif ?>
|