<?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'];

if ($css = $view->params->get('additional_css')) {
?>
<style type="text/css">
<?php echo $css; ?>
</style>
<?php
}

$view->app->triggerEvent('onSetExtraClasses', array('com_fwfoodmenu', $view));
?>
<div id="fwfm" class="fwcss fwfm-bootstrap <?php echo $view->params->get('extra_classes'); ?>">
<?php
$view->app->triggerEvent('onShowMenuTopInfo', array('com_fwfoodmenu', $view));
$categories_wrapper_classes = array('fwfm-list');
$view->app->triggerEvent('onGetCategoriesWrapperExtraClasses', array('com_fwfoodmenu', $view, &$categories_wrapper_classes));
?>
	<div class="<?php echo implode(' ', $categories_wrapper_classes); ?>">
<?php
$view->app->triggerEvent('onShowMenuListTopInfo', array('com_fwfoodmenu', $view));
if ($view->list) {
	$prev_params = $view->params;
	foreach ($view->list as $cat) {
		if (!$cat->published or ($view->app->input->getInt('wosubcats') and !count($cat->_items))) {
			continue;
		}
		$view->params = new JFParams($cat->params, fwFoodMenuHelper::getParentCategories($cat->parent));

		echo fwFoodMenuHelper::loadTemplate('menu.pdf_menu', array('view'=>$view, 'cat'=>$cat));
	}
	$view->params = $prev_params;
}
?>
	</div>
</div>
