extension)) { $this->extension = $this->input->get('extension', 'com_jce'); } } /** * Method to display a view. * * @param bool $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()} * * @return JController This object to support chaining * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { // Get the document object. $document = JFactory::getDocument(); $app = JFactory::getApplication(); $user = JFactory::getUser(); JFactory::getLanguage()->load('com_jce', JPATH_ADMINISTRATOR); // Set the default view name and format from the Request. $vName = $app->input->get('view', 'cpanel'); $vFormat = $document->getType(); $lName = $app->input->get('layout', 'default'); // legacy front-end popup view if ($vName === "popup") { // add a view path $this->addViewPath(JPATH_SITE . '/components/com_jce/views'); $view = $this->getView($vName, $vFormat); if ($view) { $view->display(); } return $this; } $adminViews = array('config', 'profiles', 'profile', 'mediabox'); if (in_array($vName, $adminViews) && !$user->authorise('core.manage', 'com_jce')) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } // create view $view = $this->getView($vName, $vFormat); // Get and render the view. if ($view) { if ($vName != "cpanel") { // use "profiles" for validating "profile" view if ($vName == "profile") { $vName = "profiles"; } if (!$user->authorise('jce.' . $vName, 'com_jce')) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } } // reset view name $vName = $view->getName(); // Get the model for the view. $model = $this->getModel($vName, 'JceModel', array('name' => $vName)); // Push the model into the view (as default). $view->setModel($model, true); $view->setLayout($lName); // Push document object into the view. $view->document = $document; // only for Joomla 3.x if (version_compare(JVERSION, '4', 'lt')) { // Load the submenu. require_once JPATH_ADMINISTRATOR . '/components/com_jce/helpers/admin.php'; JceHelperAdmin::addSubmenu($vName); } $document->addStyleSheet(JURI::root(true) . '/media/com_jce/css/global.min.css?' . md5(WF_VERSION)); $view->display(); } return $this; } }