2016-05-04 04:53:33 +00:00
|
|
|
<?php
|
2018-08-07 13:27:08 +00:00
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
|
|
|
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
2021-01-03 16:49:35 +00:00
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
2018-08-07 13:27:08 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
2016-05-04 04:53:33 +00:00
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
?>
|
|
|
|
###BOM###
|
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
2020-05-25 16:17:00 +00:00
|
|
|
use Joomla\Utilities\ArrayHelper;
|
|
|
|
|
2016-05-04 04:53:33 +00:00
|
|
|
/**
|
|
|
|
* ###Component### ###View### Controller
|
|
|
|
*/
|
|
|
|
class ###Component###Controller###View### extends JControllerLegacy
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Import an spreadsheet.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function import()
|
|
|
|
{
|
|
|
|
// Check for request forgeries
|
|
|
|
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
|
|
|
|
2016-05-04 05:51:30 +00:00
|
|
|
$model = $this->getModel('###View###');
|
2016-05-04 04:53:33 +00:00
|
|
|
if ($model->import())
|
|
|
|
{
|
|
|
|
$cache = JFactory::getCache('mod_menu');
|
|
|
|
$cache->clean();
|
|
|
|
// TODO: Reset the users acl here as well to kill off any missing bits
|
|
|
|
}
|
|
|
|
|
|
|
|
$app = JFactory::getApplication();
|
|
|
|
$redirect_url = $app->getUserState('com_###component###.redirect_url');
|
|
|
|
if (empty($redirect_url))
|
|
|
|
{
|
|
|
|
$redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// wipe out the user state when we're going to redirect
|
|
|
|
$app->setUserState('com_###component###.redirect_url', '');
|
|
|
|
$app->setUserState('com_###component###.message', '');
|
|
|
|
$app->setUserState('com_###component###.extension_message', '');
|
|
|
|
}
|
|
|
|
$this->setRedirect($redirect_url);
|
|
|
|
}
|
|
|
|
}
|