<?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;
$add_params = $view->app->getParams()->get('add_params');
$image_position = empty($add_params['category_image_position'])?$row->params->get('category_image_position', 'left'):$add_params['category_image_position'];
$category_text_alignment = $view->app->getParams()->get('category_text_alignment', $row->params->get('category_text_alignment', 'left'));
$add_classes = 'uk-width-1-3@l uk-width-1-2@s fwfm-category-align-'.$category_text_alignment.' fwfm-category-image-'.$image_position;
$view->app->triggerEvent('onGetCategoryItemExtraClasses', array('com_fwfoodmenu', $view, &$add_classes));
?>
<div class="fwfm-category-wrapper <?php echo $add_classes; ?>">
	<div class="fwfm-category-item">
		<a class="fwfm-category-item-link" href="<?php echo fwFoodMenuHelper::route('&view=menu&id='.$row->id.':'.$row->alias); ?>">
<?php
$view->app->triggerEvent('onShowCategoryItemHeader', array('com_fwfoodmenu', $view, $row, 'image'));
?>
			<div class="fwfm-category-description">
<?php
$view->app->triggerEvent('onShowCategoryItemHeader', array('com_fwfoodmenu', $view, $row, 'slideshow'));
?>
				<div class="fwfm-category-description-wrapper">
					<div class="fwfm-category-description-title"><?php echo $row->name; ?></div>
<?php
if ($view->app->getParams()->get('display_category_shortdescription', $row->params->get('display_category_shortdescription', 1)) and $row->short_description) {
?>
					<div class="fwfm-category-description-text">
						<?php echo $row->short_description; ?>
					</div>
<?php
}
if ($view->params->get('show_menu_button', 1)) {
?>
					<span class="uk-button">
						<?php echo JText::_('FWFM_VIEW_MENU'); ?>
					</span>
<?php
}
if ($view->params->get('show_meals_total', 1)) {
?>
					<div class="fwfm-category-meals">
						<?php echo fwFoodMenuHelper::countMealsQty($row->id); ?> <?php echo JText::_('FWFM_MEALS'); ?>
					</div>
<?php
}
?>
				</div>
			</div>
		</a>
	</div>
</div>
