<?php
/**
 * FW Food menu 5.1.1
 * @copyright (C) 2020 Fastw3b
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.fastw3b.net/ Official website
 **/

defined( '_JEXEC' ) or die( 'Restricted access' );

$view = $displayData['view'];

$row = $view->row;

$additional_classes = ' fwfm-menu-item-'.$row->id;
$view->app->triggerEvent('onCollectMenuStatus', array('com_fwfoodmenu', $view, $row, &$additional_classes));

$additional_styles = '';
$view->app->triggerEvent('onCollectMenuCustomStyles', array('com_fwfoodmenu', $view, $row, &$additional_styles));


$price_block = '';
$view->app->triggerEvent('onGetMenuPriceBlock', array('com_fwfoodmenu', $view, $row, &$price_block));

?>
<div class="fwfm-menu-item <?php echo $additional_classes; ?>" data-cat="<?php echo $row->category_id; ?>"<?php if ($additional_styles) { ?> style="<?php echo $additional_styles; ?>"<?php } ?> data-name="<?php echo $view->escape($row->name); ?>" data-description="<?php echo $view->escape(strip_tags($row->description)); ?>">
	<div class="fwfm-meal-promo fwfm-meal-promo-motd"><?php echo fwFoodMenuHelper::jtext('FWFM_SITE_MODPROMO_FILTERMEALOFTHEDAY'); ?></div>
	<a name="<?php echo $view->escape(urlencode($row->name)); ?>"></a>
<?php
$view->app->triggerEvent('onShowMenuItemHeader', array('com_fwfoodmenu', $view, $row));
?>
	<div class="fwfm-menu-item-text">
<?php
$view->app->triggerEvent('onShowMenuPromoTopBadges', array('com_fwfoodmenu', $view, $row));
?>
		<div class="fwfm-menu-item-title">
			<span><a class="fwfm-modal" href="<?php echo fwFoodMenuHelper::route('index.php?option=com_fwfoodmenu&view=item&id='.$row->id.':'.JFilterOutput::stringURLSafe($row->name)); ?>"><?php echo $row->name; ?></a></span>
<?php
$view->app->triggerEvent('onShowMenuPromoHeaderIcons', array('com_fwfoodmenu', $view, $row));
?>

			<div class="fwfm-menu-item-price">
<?php
if ($price_block) {
	echo $price_block;
} elseif (!empty($row->_prices[0]->price)) {
	echo fwFoodMenuHelper::formatPrice($row->_prices[0]->price);
}
$view->app->triggerEvent('onShowMenuPriceOptions', array('com_fwfoodmenu', $view, $row));
?>
			</div>
		</div>
<?php
$view->app->triggerEvent('onShowMenuPromoBlock', array('com_fwfoodmenu', $view, $row));
?>
		<div class="fwfm-menu-item-description">
			<?php echo $row->description; ?>
		</div>
<?php
$view->app->triggerEvent('onShowMenuPromoBottom', array('com_fwfoodmenu', $view, $row));
?>
	</div>
</div>
