| Current Path : /home/purehotels/public_html/components/com_easyfolderlistingpro/controllers/ |
| Current File : /home/purehotels/public_html/components/com_easyfolderlistingpro/controllers/explorer.raw.php |
<?php
/**
* @version 3.2
* @author Michael A. Gilkes (michael@valorapps.com)
* @copyright Michael Albert Gilkes
* @license GNU/GPLv3
Easy Folder Listing Pro Component for Joomla!
Copyright (C) 2012-2016 Michael Albert Gilkes (Valor Apps)
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/>.
*/
//No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Explorer SubController of EasyFolderListingPro component
*/
class EasyFolderListingProControllerExplorer extends JControllerLegacy
{
/**
* Specify the model that we will use.
*/
public function getModel($name = 'Explorer', $prefix = 'EasyFolderListingProModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
/**
* Changes the explorer view to the specified folder's content
*/
public function folder()
{
//Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
//get the document object
$document = JFactory::getDocument();
//viewType should be 'raw'
$viewType = $document->getType();
//create the view object
$view = $this->getView('explorer', $viewType);
// Get/Create the model
if ($model = $this->getModel())
{
// Push the model into the view (as default)
$view->setModel($model, true);
}
//asign the document object to the view
$view->assignRef('document', $document);
//process data and download the archive
$view->display();
//I think I am supposed to return the controller object to support chaining.
//However, the script may never get here, since view->download() exits.
return $this;
}
}