- md5
- dde1aa2c8c75e1c9d79d1674db5e1daf
- sha1
- 9a8dfd435cc6928d51cccc05101e174212c38b81
- sha256
- b0f61eedcb8897f3b1e17d5d00590cbf6cee1f96fa01ab4da25027d706e1d6eb
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
<?php
/**
* @package Joomla.Administrator
* @subpackage com_postinstall
*
* @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\Postinstall\Administrator\View\Messages;
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;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Model class to display postinstall messages
*
* @since 3.2
*/
class HtmlView extends BaseHtmlView
{
/**
* An array of items
*
* @var array
*
* @since 5.2.0
*/
protected $items;
/**
* Executes before rendering the page for the Browse task.
*
* @param string $tpl Subtemplate to use
*
* @return void
*
* @since 3.2
*/
public function display($tpl = null)
{
/** @var MessagesModel $model */
$model = $this->getModel();
$this->items = $model->getItems();
if (!\count($this->items)) {
$this->setLayout('emptystate');
}
$this->joomlaFilesExtensionId = $model->getJoomlaFilesExtensionId();
$this->eid = (int) $model->getState('eid', $this->joomlaFilesExtensionId);
if (empty($this->eid)) {
$this->eid = $this->joomlaFilesExtensionId;
}
$this->toolbar();
$this->token = Factory::getApplication()->getSession()->getFormToken();
$this->extension_options = $model->getComponentOptions();
ToolbarHelper::title(Text::sprintf('COM_POSTINSTALL_MESSAGES_TITLE', $model->getExtensionName($this->eid)), 'bell');
parent::display($tpl);
}
/**
* displays the toolbar
*
* @return void
*
* @since 3.6
*/
private function toolbar()
{
$toolbar = $this->getDocument()->getToolbar();
if (!empty($this->items)) {
$toolbar->unpublish('message.hideAll', 'COM_POSTINSTALL_HIDE_ALL_MESSAGES');
}
// Options button.
if ($this->getCurrentUser()->authorise('core.admin', 'com_postinstall')) {
$toolbar->preferences('com_postinstall');
$toolbar->help('Post-installation_Messages_for_Joomla_CMS');
}
}
}
The same content is in 29 releases, Joomla 6.1.0-alpha3 to 6.2.1-rc1. See them all, or every version of this file.