CoreFiles by mySites.guru
HtmlView.php82 lines, 2,077 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
8a9141d0e35668395ae5ddd62dffba7f
sha1
89a4cdf1525f5d2f3ccf87eab80eea1a480813ee
sha256
0da3ad154752d92c36d542a93d4d02ad22693bb933f0ded966942955972e62c6
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_postinstall
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Postinstall\Administrator\View\Messages;

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Postinstall\Administrator\Model\MessagesModel;

/**
 * Model class to display postinstall messages
 *
 * @since  3.2
 */
class HtmlView extends BaseHtmlView
{
	/**
	 * Executes before rendering the page for the Browse task.
	 *
	 * @param   string  $tpl  Subtemplate to use
	 *
	 * @return  boolean  Return true to allow rendering of the page
	 *
	 * @since   3.2
	 */
	public function display($tpl = null)
	{
		/** @var MessagesModel $model */
		$model = $this->getModel();

		$this->items = $model->getItems();

		$this->joomlaFilesExtensionId = $model->getJoomlaFilesExtensionId();
		$this->eid                    = (int) $model->getState('eid', $this->joomlaFilesExtensionId, 'int');

		if (empty($this->eid))
		{
			$this->eid = $this->joomlaFilesExtensionId;
		}

		$this->toolbar();

		$this->token = Factory::getSession()->getFormToken();
		$this->extension_options = $model->getComponentOptions();

		ToolbarHelper::title(Text::sprintf('COM_POSTINSTALL_MESSAGES_TITLE', $model->getExtensionName($this->eid)));

		return parent::display($tpl);
	}

	/**
	 * displays the toolbar
	 *
	 * @return  void
	 *
	 * @since   3.6
	 */
	private function toolbar()
	{
		// Options button.
		if (Factory::getUser()->authorise('core.admin', 'com_postinstall'))
		{
			ToolbarHelper::preferences('com_postinstall', 550, 875);
			ToolbarHelper::help('JHELP_COMPONENTS_POST_INSTALLATION_MESSAGES');
		}

		if (!empty($this->items))
		{
			ToolbarHelper::custom('message.hideAll', 'unpublish.png', 'unpublish_f2.png', 'COM_POSTINSTALL_HIDE_ALL_MESSAGES', false);
		}
	}
}

The same content is in 5 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha12. See them all, or every version of this file.