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

$this->app->triggerEvent('onShowMenuListTopInfo', array('com_fwfoodmenu', $this));
if ($this->list) {
	$prev_params = $this->params;
	foreach ($this->list as $cat) {
		if (!$cat->published or ($this->app->input->getInt('wosubcats') and !count($cat->_items))) {
			continue;
		}
		$this->params = new JFParams($cat->params, fwFoodMenuHelper::getParentCategories($cat->parent));

		echo fwFoodMenuHelper::loadTemplate('menu.menu', array('view'=>$this, 'cat'=>$cat));
	}
	$this->params = $prev_params;
}
