CoreFiles by mySites.guru
HtmlView.php69 lines, 1,435 bytes, from Joomla_4.0.0-rc3-Release_Candidate-Full_Package.zip
Raw History Compare with 4.0.0-rc2
md5
716f4f866ad0b0b33a6582978c88e541
sha1
8207ca76378434e02f921b8c529a5f4f8b62b830
sha256
d4acb9a7e7548f9def3f1b925eb177f9c5ce6a2988d43170b635fd72488583da
<?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  \JObject
	 */
	protected $state;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  A template file to load. [optional]
	 *
	 * @return  mixed  \Exception on failure, void on success.
	 *
	 * @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);
		}

		return parent::display($tpl);
	}
}

The same content is in 4 releases, Joomla 4.0.0-beta7 to 4.0.0-rc3. See them all, or every version of this file.