- md5
- a39d312b7637c6e4fb46fc7a2db862b5
- sha1
- b2544d71fdd5ec1124c6821a74c50b73f4e77b7b
- sha256
- 3b0405d326d7bf98e26974ab6138965cd6550130cceed5181ce5d2ef5f1122ef
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
<?php
/**
* @package Joomla.Site
* @subpackage com_contenthistory
*
* @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\Contenthistory\Site\Dispatcher;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Dispatcher\ComponentDispatcher;
use Joomla\CMS\MVC\Controller\BaseController;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* ComponentDispatcher class for com_contenthistory
*
* @since 4.0.0
*/
class Dispatcher extends ComponentDispatcher
{
/**
* Load the language
*
* @since 4.0.0
*
* @return void
*/
protected function loadLanguage()
{
// Load common and local language files.
$this->app->getLanguage()->load($this->option, JPATH_ADMINISTRATOR) ||
$this->app->getLanguage()->load($this->option, JPATH_SITE);
}
/**
* Method to check component access permission
*
* @since 4.0.0
*
* @return void
*
* @throws \Exception|NotAllowed
*/
protected function checkAccess()
{
// Check the user has permission to access this component if in the backend
if ($this->app->getIdentity()->guest) {
throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
}
}
/**
* Get a controller from the component
*
* @param string $name Controller name
* @param string $client Optional client (like Administrator, Site etc.)
* @param array $config Optional controller config
*
* @return BaseController
*
* @since 4.0.0
*/
public function getController(string $name, string $client = '', array $config = []): BaseController
{
$config['base_path'] = JPATH_ADMINISTRATOR . '/components/com_contenthistory';
$client = 'Administrator';
return parent::getController($name, $client, $config);
}
}
The same content is in 92 releases, Joomla 5.3.0-beta3 to 6.2.1-rc1. See them all, or every version of this file.