<?php $megaMenu = $this->getMegamenuItems(); ?>
<?php $themeHelper = $this->helper('MGS\Mpanel\Helper\Data'); ?>
<div class="widget megamenu-widget vertical-menu-widget">
	<?php if($this->hasData('mgs_panel_title') || $this->hasData('mgs_panel_note')): ?>
		<div class="content-heading">
			<?php if($this->hasData('mgs_panel_title')): ?>
				<h2 class="title"><?php echo $themeHelper->decodeHtmlTag($this->getData('mgs_panel_title')) ?></h2>
			<?php endif ?>
			<?php if($this->hasData('mgs_panel_note')): ?>
				<div class="block-note"><?php echo $themeHelper->decodeHtmlTag($this->getData('mgs_panel_note')) ?></div>
			<?php endif ?>
		</div>
	<?php endif ?>
	<?php if (count($megaMenu) > 0): ?>
		<ul id="vertical-menu-<?php echo $this->getMenuId() ?>" class="vertical-menu nav nav-pills nav-main">
			<?php foreach ($megaMenu as $item): ?>
				<li class="<?php echo $this->getClass($item) ?>">
					<?php echo $this->getMenuHtml($item) ?>
				</li>
			<?php endforeach ?>
		</ul>
	<?php else: ?>
		<div role="alert" class="alert alert-warning"><?php echo __('There are no menus matching the selection.') ?></div>
	<?php endif ?>
</div>