<?php
/**
 * Pro Super Slider
 *This program is free software: you can redistribute it and/or modify it under the terms
 *of the GNU General Public License as published by the Free Software Foundation,
 *either version 3 of the License, or (at your option) any later version.
 *
 *This program is distributed in the hope that it will be useful,
 *but WITHOUT ANY WARRANTY; without even the implied warranty of
 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *GNU General Public License for more details.
 *
 *You should have received a copy of the GNU General Public License
 *along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *@author ProJoom
 *@copyright (C) 2008 - 2012 ProJoom
 *@link http://www.projoom.com/extensions/pro-super-slider.html Official website
 **/
defined('_JEXEC') or die;
jimport('joomla.application.component.controller');
class NovassController extends JController
{
	public function display($cachable = false, $urlparams = false)
	{
		require_once JPATH_COMPONENT.'/helpers/novass.php';
		NovassHelper::updateReset();
		NovassHelper::addSubmenu(JRequest::getCmd('view', 'slides'));

		$view	= JRequest::getCmd('view', 'slides');
		$layout = JRequest::getCmd('layout', 'default');
		$id		= JRequest::getInt('id');
		if ($view == 'slide' && $layout == 'edit' && !$this->checkEditId('com_novass.edit.slide', $id)) {
			$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
			$this->setMessage($this->getError(), 'error');
			$this->setRedirect(JRoute::_('index.php?option=com_novass&view=slides', false));

			return false;
		}
        JRequest::setVar('view', JRequest::getCmd('view', 'slides'));
		parent::display();

		return $this;
	}
}
