view.html.php
2.62 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @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;
/**
* Sysinfo View class for the Admin component
*
* @since 1.6
*/
class AdminViewSysinfo extends JViewLegacy
{
/**
* Some PHP settings
*
* @var array
* @since 1.6
*/
protected $php_settings = array();
/**
* Config values
*
* @var array
* @since 1.6
*/
protected $config = array();
/**
* Some system values
*
* @var array
* @since 1.6
*/
protected $info = array();
/**
* PHP info
*
* @var string
* @since 1.6
*/
protected $php_info = null;
/**
* Information about writable state of directories
*
* @var array
* @since 1.6
*/
protected $directory = array();
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.6
*/
public function display($tpl = null)
{
// Access check.
if (!JFactory::getUser()->authorise('core.admin'))
{
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
$this->php_settings = $this->get('PhpSettings');
$this->config = $this->get('config');
$this->info = $this->get('info');
$this->php_info = $this->get('PhpInfo');
$this->directory = $this->get('directory');
$this->addToolbar();
$this->_setSubMenu();
return parent::display($tpl);
}
/**
* Setup the SubMenu
*
* @return void
*
* @since 1.6
* @note Necessary for Hathor compatibility
* @deprecated 4.0 To be removed with Hathor
*/
protected function _setSubMenu()
{
try
{
$contents = $this->loadTemplate('navigation');
$document = JFactory::getDocument();
$document->setBuffer($contents, 'modules', 'submenu');
}
catch (Exception $e)
{
}
}
/**
* Setup the Toolbar
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
JToolbarHelper::title(JText::_('COM_ADMIN_SYSTEM_INFORMATION'), 'info-2 systeminfo');
JToolbarHelper::link(JRoute::_('index.php?option=com_admin&view=sysinfo&format=text'), 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_TEXT', 'download');
JToolbarHelper::link(JRoute::_('index.php?option=com_admin&view=sysinfo&format=json'), 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_JSON', 'download');
JToolbarHelper::help('JHELP_SITE_SYSTEM_INFORMATION');
}
}