<?php
/**
 * @copyright	Copyright (c) 2015 Skyline Technology Ltd (http://extstore.com). All rights reserved.
 * @license		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

// No direct access.
defined('_JEXEC') or die;

// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_advpopup')) {
	return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

// Include CSS and JS
JHtml::_('jquery.framework');
JHtml::_('script', 'com_advpopup/admin.script.js', false, true);
JHtml::_('stylesheet', 'com_advpopup/font-awesome.min.css', false, true);
JHtml::_('stylesheet', 'com_advpopup/admin.style.css', false, true);

// Include dependancies
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
require_once JPATH_COMPONENT . '/helpers/factory.php';

$controller	= JControllerLegacy::getInstance('AdvPopup');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();