<?php
/**
* @version		3.0.0
* @package		JomLand TicketCenter
* @copyright	Copyright (C) 2010 JomLand.com. All rights reserved.
* @link 		www.jomland.com
* @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');


class JLTicketCenterViewCategory extends JViewLegacy
{
	function display($tpl = null)
	{
		$app =  JFactory::getApplication();
		$pathway = $app->getPathway();
		
		$document =  JFactory::getDocument();
		$document->addStyleSheet(JURI::base().'components/com_jlticketcenter/assets/jlticketcenter.css');
		
		$pparams = new JLTicketCenterHelperSetup;
		
		$menuitemid = JRequest::getInt('Itemid');
		 if ($menuitemid)
		 {
            $menu = $app->getMenu();
		    $menuparams = $menu->getParams($menuitemid);
		 }else{
			$menuparams = JComponentHelper::getParams('com_jlticketcenter');
		 }
		
		 // Assign Menu Params to Request
		 if (!JRequest::getInt('id',0)){
		 	if ($menuparams->get('cat_id',0)>0){
		 		JRequest::setVar('id',$menuparams ->get('cat_id',0));
		 	}	
		 }
		

		$category = $this->get('Category');
		$items =$this->get('CategoryPerformers');

		if ($category){
		 	$pathway->addItem($category->title, '');
		}
		
		$menu = $app->getMenu()->getActive();;
		
		if ($menu->component!='com_jlticketcenter'){

			$menu 		= $app->getMenu();
			$bit_itemid = $menu->getItems('component','com_jlticketcenter');
			$Itemid  	= $bit_itemid[0]->id;
		}
		else{
			$Itemid  	= $menu->id;
		}
		
		$this->assignRef('category',	$category);
		$this->assignRef('items',	$items);
		$this->assignRef('params',	$pparams);
		$this->assignRef('itemid',	$Itemid );
		$this->assignRef('menuparams', $menuparams);
		 

		parent::display($tpl);
		JLTicketCenterLinksHelper::renderinfo();
	}
		
} // EOC VIEW