<?php
/**
* @version 1.0.0
* @package RSEvents! 1.0.0
* @copyright (C) 2009 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined( '_JEXEC' ) or die( 'Restricted access' ); 
jimport( 'joomla.application.component.view');

class rseventsViewDesigns extends JView
{
	function display($tpl = null)
	{
		$task=JRequest::getVar('task','','request');
		switch($task)
		{
			
			case 'listdesigns':
			{
				JToolBarHelper::title(JText::_('RSE_DESIGN_LIST'),'generic.png');
				JToolBarHelper::makeDefault('makeDefault');
				JToolBarHelper::deleteList(JText::_('RSE_DESIGN_DELETE_CONFIRM'), 'remove' , "Delete");
				JToolBarHelper::publishList();
				JToolBarHelper::unpublishList();
				JToolBarHelper::custom('main','preview.png','preview_f2.png',JText::_('RSE_RS_PRODUCT'),false);
				
				$listDesigns=$this->get('data');
				$pagination=$this->get('pagination');
				
				$filter			=JRequest::getVar('rs_filter');
				$sortColumn		=JRequest::getVar('filter_order','#__rsevents_designs.ordering');
				$sortOrder	=JRequest::getVar('filter_order_Dir','asc');
				
				$this->assignRef('filter',$filter);
				$this->assignRef('sortColumn',$sortColumn);
				$this->assignRef('sortOrder',$sortOrder);
				$this->assignRef('data',$listDesigns);
				$this->assignRef('pagination',$pagination);
				$this->assignRef('filter',$filter);
				$this->assignRef('sortColumn',$sortColumn);
				$this->assignRef('sortOrder',$sortOrder);

			} break;
			
			case 'editdesign':
				$design = $this->get('Design');

				$params = new JParameter( $design->params );
				$params->loadSetupFile(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'designs'.DS.'default'.DS.'config.xml');
				echo('color:'.$params->get('color',''));
			break;		
		}
		parent::display($tpl);
	}
}