<?php
$options = (array)$block['options'];
$items   = (array)$block['items'];
$target  = $options['target_new'] ? '_self' : '_blank';
switch ($options['max_rows']) {
    case '0':
    case '1':
        $rows = 'col-lg-12 col-md-12 col-12';
        break;

    case '2':
        $rows = 'col-lg-6 col-md-6 col-12';
        break;

    case '3':
        $rows = 'col-lg-4 col-md-4 col-12';
        break;

    case '4':
        $rows = 'col-lg-3 col-md-3 col-12';
        break;

    case '6':
        $rows = 'col-lg-2 col-md-2 col-12';
        break;

    case '12':
        $rows = 'col-lg-1 col-md-1 col-12';
        break;
}
?>
<div class="widget-list widget-list-title">
    <div class="row clearfix">
        <?php foreach ($items as $item) { ?>
            <li class="<?php echo $rows; ?>">
                <?php if (!empty($item['link'])) { ?>
                    <a href="<?php echo $item['link']; ?>"
                       title="<?php echo _escape($item['caption']); ?>"
                       class="pi-ellipsis pi-ellipsis-1"
                       target="<?php echo $target; ?>"
                    >
                        <?php echo _escape($item['caption']); ?>
                    </a>
                <?php } else { ?>
                    <?php echo _escape($item['caption']); ?>
                <?php } ?>
            </li>
        <?php } ?>
        </ul>
    </div>
</div>