- md5
- 69d5dad8a401f471461a27997bbea634
- sha1
- 5ff4437a0feb9f605e55c5928130901c0dcc4a1f
- sha256
- abe66ceba136c760bbce34b1c3090f3e4c3cc3d962b08f3c2ad13a12a0a83d27
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
<?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;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\Component\Config\Administrator\Controller\RequestController;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* 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 = $this->getCurrentUser();
$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;
// Add form control fields
$this->form
->addControlField('task', '');
$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->getDocument()->setDescription($params->get('menu-meta_description'));
}
if ($params->get('robots')) {
$this->getDocument()->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 18 releases, Joomla 6.0.0-beta1 to 6.1.0-alpha2. See them all, or every version of this file.