CoreFiles by mySites.guru
view.raw.php49 lines, 1,196 bytes, from Joomla_3.8.2-Stable-Full_Package.zip
Raw History Compare with 3.8.1
md5
a3da76b62a3b200a11604cfa5a0c3645
sha1
2c5e27355b3d70552800ba4c7fc9286303404a7e
sha256
89280f14f49c593e001a3f07669f3a3d2fb605be1b833b6eb255f61b26299388
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_banners
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * View class for a list of tracks.
 *
 * @since  1.6
 */
class BannersViewTracks extends JViewLegacy
{
	/**
	 * Display the view
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  void
	 */
	public function display($tpl = null)
	{
		$basename = $this->get('BaseName');
		$filetype = $this->get('FileType');
		$mimetype = $this->get('MimeType');
		$content  = $this->get('Content');

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		$document = JFactory::getDocument();
		$document->setMimeEncoding($mimetype);
		JFactory::getApplication()
			->setHeader(
				'Content-disposition',
				'attachment; filename="' . $basename . '.' . $filetype . '"; creation-date="' . JFactory::getDate()->toRFC822() . '"',
				true
			);
		echo $content;
	}
}

The same content is in 20 releases, Joomla 3.7.3-beta1 to 3.8.3. See them all, or every version of this file.