- md5
- e2721fe860c248ac8bb2055021d14b9a
- sha1
- 8bcf909cf11540b3392a932ce9633cc1610d64cf
- sha256
- 12fa2a84960fbe2ae9dab1bf4302f560315d1e4b064cf60ce06a93de8ca5a359
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
<?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;
\defined('_JEXEC') or die;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Dispatcher\ComponentDispatcher;
use Joomla\CMS\MVC\Controller\BaseController;
/**
* 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 = array()): BaseController
{
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
$client = 'Administrator';
return parent::getController($name, $client, $config);
}
}
The same content is in 51 releases, Joomla 4.0.0-beta6 to 4.2.0-beta2. See them all, or every version of this file.