<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;

/**
 * Content Component Controller
 *
 * @since  1.5
 */
class Os_CCKController extends JControllerLegacy
{
	/**
	 * Constructor.
	 *
	 * @param   array  $config  An optional associative array of configuration settings.
	 * Recognized key values include 'name', 'default_task', 'model_path', and
	 * 'view_path' (this list is not meant to be comprehensive).
	 *
	 * @since   3.0.1
	 */
	public function __construct($config = array())
	{

		parent::__construct($config);
	}

	/**
	 * Method to display a view.
	 *
	 * @param   boolean  $cachable   If true, the view output will be cached.
	 * @param   boolean  $urlparams  An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
	 *
	 * @return  JController  This object to support chaining.
	 *
	 * @since   1.5
	 */
	public function display($cachable = false, $urlparams = false)
	{
                $cachable = true;
                $this->basePath = JURI::root() . 'components/com_os_cck';
                if($this->input->get('option') == 'com_simplemembership'){
                    $this->default_view = 'user_instances';
                }

//                $this->task = 'all_instance';
                $this->paths['view'][0] = JPATH_SITE . '/components/com_os_cck/views/';
                
		$safeurlparams = array(
			'catid' => 'INT',
			'id' => 'INT',
			'catid' => 'ARRAY',
			'year' => 'INT',
			'month' => 'INT',
			'limit' => 'UINT',
			'limitstart' => 'UINT',
			'showall' => 'INT',
			'return' => 'BASE64',
			'filter' => 'STRING',
			'filter_order' => 'CMD',
			'filter_order_Dir' => 'CMD',
			'filter-search' => 'STRING',
			'print' => 'BOOLEAN',
			'lang' => 'CMD',
			'Itemid' => 'INT',
                        'eiid' => 'INT',
                        'eid' => 'INT',
                        'lid' => 'INT',
                        'currency' => 'STRING',
                        'month_selected' => 'STRING',
                        'year_selected' => 'STRING',
						);



		parent::display($cachable, $safeurlparams);

		return $this;
	}
}
