CoreFiles by mySites.guru
HtmlView.php69 lines, 1,406 bytes, from Joomla_4.0.6-Stable-Full_Package.zip
Raw History Compare with 4.0.5
md5
c748cfb50a9c93368dd47e53d065b2c9
sha1
70b9c702d58bc21479e74c1900b600cd82f9bda4
sha256
156edfff843ad2c598ba60cf92cb2d3ec05fe8f8875a248f3cd44f0c4fa38f61
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_contenthistory
 *
 * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Contenthistory\Administrator\View\Preview;

\defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;

/**
 * View class for a list of contenthistory.
 *
 * @since  1.5
 */
class HtmlView extends BaseHtmlView
{
	/**
	 * An array of items
	 *
	 * @var  \stdClass|false
	 */
	protected $item;

	/**
	 * The model state
	 *
	 * @var  \Joomla\CMS\Object\CMSObject
	 */
	protected $state;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  A template file to load. [optional]
	 *
	 * @return  void
	 *
	 * @since   3.2
	 */
	public function display($tpl = null)
	{
		$this->state = $this->get('State');
		$this->item  = $this->get('Item');

		if (false === $this->item)
		{
			Factory::getLanguage()->load('com_content', JPATH_SITE, null, true);

			throw new \Exception(Text::_('COM_CONTENT_ERROR_ARTICLE_NOT_FOUND'), 404);
		}

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

		parent::display($tpl);
	}
}

The same content is in 26 releases, Joomla 4.0.6-rc1 to 4.2.0-beta2. See them all, or every version of this file.