Your IP : 216.73.216.240


Current Path : /home/j/u/v/juvelize/www/components/com_ffgate/views/site/
Upload File :
Current File : /home/j/u/v/juvelize/www/components/com_ffgate/views/site/view.html.php

<?php
/**
 * @package    FFGate
 * @author     Yves Hoppe <yves@compojoom.com>
 * @date       26.11.13
 *
 * @copyright  Copyright (C) 2008 - 2013 compojoom.com - Yves Hoppe. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

defined('_JEXEC') or die ('Restricted access');

jimport('joomla.application.component.view');

/**
 * Class FFGateViewSite
 *
 * @since  1.0.0
 */
class FFGateViewSite extends JViewLegacy
{
	/**
	 * Displays the form
	 *
	 * @param   string  $tpl  - The template
	 *
	 * @return  mixed|void
	 */
	public function display($tpl = null)
	{
		$jinput = JFactory::getApplication()->input;
		$site_id = $jinput->getInt('site_id', 0);
		$format = $jinput->get("format");
		$tmpl = $jinput->get("tmpl");

		$user = JFactory::getUser();
		$params = JComponentHelper::getParams('com_ffgate');

		$menuitemid = JFactory::getApplication()->input->get('Itemid');

		if ($menuitemid)
		{
			$site = new JSite;
			$menu = $site->getMenu();
			$menuparams = $menu->getParams($menuitemid);
			$params->merge($menuparams);
		}

		if (empty($site_id))
		{
			$site_id = $params->get('site_id', 0);
		}

		$public = $params->get('public', 0);

		// Just some very basic security
		$sec_key = $params->get('secure_key', 'keytosecurethepage');

		$secure = $jinput->get('sec_key', '', 'string');

		if (!$public)
		{
			if ($sec_key != $secure)
			{
				JError::raiseError(403, JText::_("COM_FFGATE_NO_ACCESS"));

				return;
			}
		}

		$model = $this->getModel();
		$site = $model->getSite($site_id);

		$this->site_id = $site_id;
		$this->user = $user;
		$this->site = $site;
		$this->params = $params;
		$this->public = $public;
		$this->format = $format;
		$this->tmpl = $tmpl;

		parent::display($tpl);
	}
}