CoreFiles by mySites.guru
DisplayController.php63 lines, 1,677 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
0c4c4af3a928a82e7e54849e2f5fdfb4
sha1
d8dcd7bafe36c5aa7ed2726d740baaa1cc396598
sha256
2b354b8eb20fffa7361b5c9fdb90dcc128950fb4dd6b6c82b5dfd3173d72f410
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_csp
 *
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @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-bs-toggle="modal" id="title-' . $httpHeadersId . '"'
			);

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

		return parent::display();
	}
}

No other release has this exact content. See every version of this file.