CoreFiles by mySites.guru
DisplayController.php63 lines, 1,687 bytes, from Joomla_4.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta
md5
fd1cb005aa0a91aa83fab3d431df142f
sha1
75f0710b79672ad07b6cc55a7dceba2beb8b41c1
sha256
f6d8582e7eba9e1cdaf3c870c30a98a222cd12093f0a8d3cebcad1c69942ee78
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_csp
 *
 * @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\Csp\Administrator\Controller;

\defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Component\Csp\Administrator\Helper\ReporterHelper;

/**
 * Csp display controller.
 *
 * @since  4.0.0
 */
class DisplayController extends BaseController
{
	/**
	 * The default view.
	 *
	 * @var     string
	 * @since   4.0.0
	 */
	protected $default_view = 'reports';

	/**
	 * Method to display a view.
	 *
	 * @param   boolean  $cachable   If true, the view output will be cached.
	 * @param   mixed    $urlparams  An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
	 *
	 * @return  static   This object to support chaining.
	 *
	 * @since   4.0.0
	 */
	public function display($cachable = false, $urlparams = false)
	{
		// Show messages about the plugin when it is disabled
		if (!PluginHelper::isEnabled('system', 'httpheaders'))
		{
			$httpHeadersId = ReporterHelper::getHttpHeadersPluginId();
			$link = HTMLHelper::_(
				'link',
				'#plugin' . $httpHeadersId . 'Modal',
				Text::_('COM_CSP_SYSTEM_PLUGIN'),
				'class="alert-link" data-toggle="modal" id="title-' . $httpHeadersId . '"'
			);

			$this->app->enqueueMessage(Text::sprintf('COM_CSP_PLUGIN_MODAL_DISABLED', $link), 'error');
		}

		return parent::display();
	}
}

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.