<?php
/** 
 * @package     VikRestaurants
 * @subpackage  core
 * @author      E4J s.r.l.
 * @copyright   Copyright (C) 2023 E4J s.r.l. All Rights Reserved.
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link        https://vikwp.com
 */

// No direct access
defined('ABSPATH') or die('No script kiddies please!');

/**
 * Layout variables
 * -----------------
 * @var  string  $class    An extra class suffix.
 * @var  string  $title    The widget title.
 * @var  string  $icon     The widget icon.
 * @var  string  $summary  The widget short summary.
 * @var  string  $body     The widget body.
 * @var  string  $footer   The widget footer.
 */
extract($displayData);

?>

<div class="addon-widget<?php echo !empty($class) ? ' ' . $class : ''; ?>">

    <?php if (!empty($title)): ?>
        <div class="addon-widget-head">
            <?php if (!empty($icon)): ?>
                <?php if (substr($icon, 0, 1) === '<'): ?>
                    <?php echo $icon; ?>
                <?php else: ?>
                    <i class="<?php echo $this->escape($icon); ?>"></i>
                <?php endif; ?>
            <?php endif; ?>

            <span class="addon-widget-title"><?php echo $title; ?></span>
        </div>
    <?php endif; ?>
        
    <?php if (!empty($summary)): ?>
        <div class="addon-widget-summary"><?php echo $summary; ?></div>
    <?php endif; ?>

    <?php if (!empty($body)): ?>
        <div class="addon-widget-body"><?php echo $body; ?></div>
    <?php endif; ?>

    <?php if (!empty($footer)): ?>
        <hr />
        <div class="addon-widget-footer"><?php echo $footer; ?></div>
    <?php endif; ?>

</div>