- md5
- 16cc35241491de5b32d8da056b10d86f
- sha1
- 44970f5036794257c56949d34e73c1892f6f421c
- sha256
- f100844d42514184648a06ba10e191d2453d89db312f4d512c3a1c1892f0b467
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Admin\Administrator\View\Sysinfo;
\defined('_JEXEC') or die;
use Exception;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Admin\Administrator\Model\SysinfoModel;
/**
* Sysinfo View class for the Admin component
*
* @since 1.6
*/
class HtmlView extends BaseHtmlView
{
/**
* Some PHP settings
*
* @var array
* @since 1.6
*/
protected $phpSettings = [];
/**
* Config values
*
* @var array
* @since 1.6
*/
protected $config = [];
/**
* Some system values
*
* @var array
* @since 1.6
*/
protected $info = [];
/**
* PHP info
*
* @var string
* @since 1.6
*/
protected $phpInfo = null;
/**
* Information about writable state of directories
*
* @var array
* @since 1.6
*/
protected $directory = [];
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*
* @since 1.6
*
* @throws Exception
*/
public function display($tpl = null): void
{
// Access check.
if (!Factory::getUser()->authorise('core.admin'))
{
throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}
/** @var SysinfoModel $model */
$model = $this->getModel();
$this->phpSettings = $model->getPhpSettings();
$this->config = $model->getconfig();
$this->info = $model->getinfo();
$this->phpInfo = $model->getPhpInfo();
$this->directory = $model->getdirectory();
$this->addToolbar();
parent::display($tpl);
}
/**
* Setup the Toolbar
*
* @return void
*
* @since 1.6
*/
protected function addToolbar(): void
{
ToolbarHelper::title(Text::_('COM_ADMIN_SYSTEM_INFORMATION'), 'info-circle systeminfo');
ToolbarHelper::link(
Route::_('index.php?option=com_admin&view=sysinfo&format=text'),
'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_TEXT',
'download'
);
ToolbarHelper::link(
Route::_('index.php?option=com_admin&view=sysinfo&format=json'),
'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_JSON',
'download'
);
ToolbarHelper::help('JHELP_SITE_SYSTEM_INFORMATION');
}
}
The same content is in 3 releases, Joomla 4.0.0-beta3 to 4.0.0-beta5. See them all, or every version of this file.