- md5
- 9d4c617f5de9802770b5f30be2749e48
- sha1
- 79b99dbc8b47a380361530f572ec552a1a6e85ab
- sha256
- f801ffc9f048c422d5da1ed2955792bc9c6c233a52cacb8f68521c5541426c3d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
<?php
/**
* @package Joomla.Site
* @subpackage com_config
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Config\Site\View\Config;
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\Component\Config\Administrator\Controller\RequestController;
/**
* View for the global configuration
*
* @since 3.2
*/
class HtmlView extends BaseHtmlView
{
/**
* The form object
*
* @var \Joomla\CMS\Form\Form
*
* @since 3.2
*/
public $form;
/**
* The data to be displayed in the form
*
* @var array
*
* @since 3.2
*/
public $data;
/**
* Is the current user a super administrator?
*
* @var boolean
*
* @since 3.2
*/
protected $userIsSuperAdmin;
/**
* The page class suffix
*
* @var string
*
* @since 4.0.0
*/
protected $pageclass_sfx = '';
/**
* The page parameters
*
* @var \Joomla\Registry\Registry|null
*
* @since 4.0.0
*/
protected $params = null;
/**
* 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 3.2
*/
public function display($tpl = null)
{
$user = Factory::getUser();
$this->userIsSuperAdmin = $user->authorise('core.admin');
// Access backend com_config
$requestController = new RequestController;
// Execute backend controller
$serviceData = json_decode($requestController->getJson(), true);
$form = $this->getForm();
if ($form)
{
$form->bind($serviceData);
}
$this->form = $form;
$this->data = $serviceData;
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document.
*
* @return void
*
* @since 4.0.0
*/
protected function _prepareDocument()
{
$params = Factory::getApplication()->getParams();
// Because the application sets a default page title, we need to get it
// right from the menu item itself
$this->setDocumentTitle($params->get('page_title', ''));
if ($params->get('menu-meta_description'))
{
$this->document->setDescription($params->get('menu-meta_description'));
}
if ($params->get('robots'))
{
$this->document->setMetaData('robots', $params->get('robots'));
}
// Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx', ''));
$this->params = &$params;
}
}
The same content is in 25 releases, Joomla 4.0.6-rc1 to 4.2.0-beta1. See them all, or every version of this file.