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

if( file_exists(JPATH_ROOT. DS. 'components'.DS.'com_rsevents'.DS.'helpers'.DS.'calendar.php') ) {
  require_once(JPATH_ROOT. DS. 'components'.DS.'com_rsevents'.DS.'helpers'.DS.'calendar.php');

  JHTML::_('behavior.tooltip');
  
$lang = &JFactory::getLanguage();
$lang->load('com_rsevents',JPATH_ADMINISTRATOR);
$lang->load('com_rsevents',JPATH_SITE);

$document = & JFactory::getDocument();

//get the params
$params = &$params;

$class_suffix = $params->get('moduleclass_sfx');

$document->addStyleSheet(JURI::root(true).'/components/com_rsevents/style.css');
$document->addScript(JURI::root(true).'/modules/mod_rsevents_calendar/rsevents_calendar.js');

$startday = $params->get('startday','1');

// get the module output
$calendar_module = new RSEventsCalendar;
$calendar_module->is_module = true;

$month = JRequest::getVar('month', '0');
$year = JRequest::getVar('year', '0');

$calendar_module->setWeekStart($startday);
$calendar_module->setDate($month, $year);

if(!empty($class_suffix))
$calendar_module->class_suffix = '_'.$class_suffix;

echo $calendar_module->display();
} else echo JText::_('RSE_NO_RSEVENTS');
?>
