/** * @version 2.5 * @author Michael A. Gilkes (jaido7@yahoo.com) * @copyright Michael Albert Gilkes * @license GNU/GPLv2 */ /* Easy File Uploader Module for Joomla! Copyright (C) 2010-2013 Michael Albert Gilkes 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // no direct access defined('_JEXEC') or die('Restricted access'); // Include the syndicate functions only once require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'helper.php'; //check to see if the upload process has started if (isset($_FILES[$params->get('efu_variable')])) { $result = modEasyFileUploaderHelper::getFileToUpload($params); } require JModuleHelper::getLayoutPath('mod_easyfileuploader', $params->get('layout', 'default'));
private static function storeUploadedFile($filepath, &$params, &$result, &$i) { //move the file to the destination folder $success = JFile::upload($_FILES[$params->get('efu_variable')]["tmp_name"][$i], $filepath . DIRECTORY_SEPARATOR . $_FILES[$params->get('efu_variable')]["name"][$i]); if ($success) { //Upload was successful. $result .= JText::_('MOD_EFU_UPLOAD_SUCCESSFUL') . "<br />"; $result .= JText::_('MOD_EFU_NAME') . ": " . $_FILES[$params->get('efu_variable')]["name"][$i] . "<br />"; $result .= JText::_('MOD_EFU_TYPE') . ": " . $_FILES[$params->get('efu_variable')]["type"][$i] . "<br />"; $result .= JText::_('MOD_EFU_SIZE') . ": " . modEasyFileUploaderHelper::sizeToText($_FILES[$params->get('efu_variable')]["size"][$i]) . "<br />"; //$result .= "Temp file: ".$_FILES[$params->get('efu_variable')]["tmp_name"][$i]."<br />"; //$result .= "Stored in: ".$filepath; } else { $result .= JText::_('MOD_EFU_UPLOAD_UNSUCCESSFUL'); } }