[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_menus 6 * 7 * @copyright (C) 2017 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\Administrator\Controller; 12 13 use Joomla\CMS\Language\Text; 14 use Joomla\CMS\MVC\Controller\BaseController; 15 use Joomla\CMS\Router\Route; 16 use Joomla\CMS\Uri\Uri; 17 18 // phpcs:disable PSR1.Files.SideEffects 19 \defined('_JEXEC') or die; 20 // phpcs:enable PSR1.Files.SideEffects 21 22 /** 23 * Base controller class for Menu Manager. 24 * 25 * @since 1.6 26 */ 27 class DisplayController extends BaseController 28 { 29 /** 30 * The default view for the display method. 31 * 32 * @var string 33 * @since 4.0.0 34 */ 35 protected $default_view = 'menus'; 36 37 /** 38 * Method to display a view. 39 * 40 * @param boolean $cachable If true, the view output will be cached 41 * @param array|boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}. 42 * 43 * @return static This object to support chaining. 44 * 45 * @since 1.5 46 */ 47 public function display($cachable = false, $urlparams = false) 48 { 49 // Verify menu 50 $menuType = $this->input->post->getCmd('menutype', ''); 51 52 if ($menuType !== '') { 53 $uri = Uri::getInstance(); 54 55 if ($uri->getVar('menutype') !== $menuType) { 56 $uri->setVar('menutype', $menuType); 57 58 if ($forcedLanguage = $this->input->post->get('forcedLanguage')) { 59 $uri->setVar('forcedLanguage', $forcedLanguage); 60 } 61 62 $this->setRedirect(Route::_('index.php' . $uri->toString(['query']), false)); 63 64 return parent::display(); 65 } 66 } 67 68 // Check if we have a mod_menu module set to All languages or a mod_menu module for each admin language. 69 if ($langMissing = $this->getModel('Menus', 'Administrator')->getMissingModuleLanguages()) { 70 $this->app->enqueueMessage(Text::sprintf('JMENU_MULTILANG_WARNING_MISSING_MODULES', implode(', ', $langMissing)), 'warning'); 71 } 72 73 return parent::display(); 74 } 75 }
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 |