separator.php
61 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | extract($displayData); |
| 15 | |
| 16 | /** |
| 17 | * Layout variables |
| 18 | * ----------------- |
| 19 | * @var boolean $selected True whether the separator owns an active item. |
| 20 | * @var boolean $collapsed True whether the separator is collapsed. |
| 21 | * @var string $href The separator HREF, if specified. |
| 22 | * @var string $icon The custom icon, if specified. |
| 23 | * @var string $title The separator title. |
| 24 | * @var array $children The separator menu items. |
| 25 | * @var string $html The children HTML. |
| 26 | */ |
| 27 | |
| 28 | $selected = $selected || $collapsed; |
| 29 | |
| 30 | ?> |
| 31 | |
| 32 | <div class="parent"> |
| 33 | <div class="title<?php echo $selected ? ' selected' : ''; ?><?php echo strlen($href) ? ' has-href' : ''; ?>"> |
| 34 | |
| 35 | <a <?php echo strlen($href) ? 'href="' . $href . '"' : ''; ?>> |
| 36 | <?php |
| 37 | if (strlen($icon)) |
| 38 | { |
| 39 | ?><i class="fas fa-<?php echo $icon; ?>"></i><?php |
| 40 | } |
| 41 | |
| 42 | ?><span><?php echo $title; ?></span><?php |
| 43 | |
| 44 | if (count($children)) |
| 45 | { |
| 46 | ?><i class="fas fa-angle-down vap-angle-dir"></i><?php |
| 47 | } |
| 48 | ?> |
| 49 | </a> |
| 50 | |
| 51 | <?php |
| 52 | if (strlen($html)) |
| 53 | { |
| 54 | ?> |
| 55 | <div class="wrapper"><?php echo $html; ?></div> |
| 56 | <?php |
| 57 | } |
| 58 | ?> |
| 59 | |
| 60 | </div> |
| 61 | </div> |