<?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 rseventsViewMain extends JView
{
	function display($tpl = null)
	{		
		global $mainframe;
		
		$task=JRequest::getVar('task','','request');
		switch($task)
		{
			case 'main':
			default:
			{	
				JToolBarHelper::title(JText::_('RSE_MAIN_MENU'),'rsevents');
				JToolBarHelper::custom('main','preview.png','preview_f2.png',JText::_('RSE_RS_PRODUCT'),false);
				
				 $this->assignRef('rseventsConfig',$mainframe->getUserState('rseventsConfig'));
			} break;
			
			case 'update':
			{
				JToolBarHelper::title(JText::_('RSE_UPDATE'),'generic.png');
				JToolBarHelper::custom('main','preview.png','preview_f2.png',JText::_('RSE_RS_PRODUCT'),false);
				
				$rseventsConfig = $mainframe->getUserState('rseventsConfig');
				
			}
			break;
		 
		 }
		parent::display($tpl);
	}
	
	function genKeyCode(){
		global $mainframe;
		$rseventsConfig = $mainframe->getUserState('rseventsConfig');
		return md5($rseventsConfig['global.register.code'].RSE_RS_KEY);
	}
}