[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Site 5 * @subpackage com_menus 6 * 7 * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Component\Menus\Site\Dispatcher; 12 13 use Joomla\CMS\Access\Exception\NotAllowed; 14 use Joomla\CMS\Dispatcher\ComponentDispatcher; 15 use Joomla\CMS\MVC\Controller\BaseController; 16 17 // phpcs:disable PSR1.Files.SideEffects 18 \defined('_JEXEC') or die; 19 // phpcs:enable PSR1.Files.SideEffects 20 21 /** 22 * ComponentDispatcher class for com_menus 23 * 24 * @since 4.0.0 25 */ 26 class Dispatcher extends ComponentDispatcher 27 { 28 /** 29 * Load the language 30 * 31 * @since 4.0.0 32 * 33 * @return void 34 */ 35 protected function loadLanguage() 36 { 37 $this->app->getLanguage()->load('com_menus', JPATH_ADMINISTRATOR); 38 } 39 40 /** 41 * Dispatch a controller task. Redirecting the user if appropriate. 42 * 43 * @return void 44 * 45 * @since 4.0.0 46 */ 47 public function checkAccess() 48 { 49 parent::checkAccess(); 50 51 if ( 52 $this->input->get('view') !== 'items' 53 || $this->input->get('layout') !== 'modal' 54 || !$this->app->getIdentity()->authorise('core.create', 'com_menus') 55 ) { 56 throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403); 57 } 58 } 59 60 /** 61 * Get a controller from the component 62 * 63 * @param string $name Controller name 64 * @param string $client Optional client (like Administrator, Site etc.) 65 * @param array $config Optional controller config 66 * 67 * @return \Joomla\CMS\MVC\Controller\BaseController 68 * 69 * @since 4.0.0 70 */ 71 public function getController(string $name, string $client = '', array $config = array()): BaseController 72 { 73 $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; 74 $client = 'Administrator'; 75 76 return parent::getController($name, $client, $config); 77 } 78 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |