<?php
/**
 * @package     Joomla OrdaSoft ССK
 * @copyright   OrdaSoft Copyright (C)
 */

defined('_JEXEC') or die;

/**
 * HTML Article View class for the Content component
 *
 * @since  1.5
 */
class Os_CCKViewCalendar extends JViewLegacy
{
	protected $item;
	protected $params;
	protected $print;
	protected $state;
	protected $user;

	/**
	 * Execute and display a template script.
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  mixed  A string if successful, otherwise an Error object.
	 */
	public function display($tpl = null)
	{
			global $db;

			$db = new os_cckDb();
			$app        = JFactory::getApplication();
			$input      = $app->input;
			$Itemid = $input->get('Itemid', 0, 'INT');

			$menu = new JTableMenu($db->_db);
			$menu->load($Itemid);
			$params = new JRegistry;
			if($menu->params){
			  $params->loadString($menu->params);
			}
			$lid = $params->get('calendar_layout');
			if(!$lid){
				$lid = $params->get('layout');
			}

			Instance::show_calendar($input->get('option'),$lid);
		
	}
	
}
