CoreFiles by mySites.guru
view.raw.php51 lines, 1,213 bytes, from Joomla_3.7.2-Stable-Full_Package.zip
Raw History Compare with 3.7.1
md5
0518733ea738be6d7e0fa71d7b1ffc98
sha1
f6eff1fb7d47a8ecd46ec008d55cf17345dec14e
sha256
980163ee0b0f594a52c22a196b92bc30c321681a43258ace6e5e1dfad4558c5c
<?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')))
		{
			JError::raiseError(500, implode("\n", $errors));

			return false;
		}

		$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 14 releases, Joomla 3.7.0-alpha2 to 3.7.2. See them all, or every version of this file.