view.html.php
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?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
*/
defined('_JEXEC') or die;
/**
* Model class to display postinstall messages
*
* @since 3.2
*/
class PostinstallViewMessages extends FOFViewHtml
{
/**
* 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
*/
protected function onBrowse($tpl = null)
{
/** @var PostinstallModelMessages $model */
$model = $this->getModel();
$this->eid = (int) $model->getState('eid', '700', 'int');
if (empty($this->eid))
{
$this->eid = 700;
}
$this->token = JFactory::getSession()->getFormToken();
$this->extension_options = $model->getComponentOptions();
JToolBarHelper::title(JText::sprintf('COM_POSTINSTALL_MESSAGES_TITLE', $model->getExtensionName($this->eid)));
return parent::onBrowse($tpl);
}
/**
* Executes on display of the page
*
* @param string $tpl Subtemplate to use
*
* @return boolean Return true to allow rendering of the page
*
* @since 3.8.7
*/
protected function onDisplay($tpl = null)
{
$return = parent::onDisplay($tpl);
if (!empty($this->items))
{
JToolbarHelper::custom('hideAll', 'unpublish.png', 'unpublish_f2.png', 'COM_POSTINSTALL_HIDE_ALL_MESSAGES', false);
}
return $return;
}
}