CoreFiles by mySites.guru
DisplayController.php67 lines, 2,023 bytes, from Joomla_5.2.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 5.1.0-alpha4
md5
e0ed87ac4c45487082612ad231a53db8
sha1
06daf1cc7746cbe41461a54b6f46fa5e9b7e74bb
sha256
be3b7fc6637752c8225cfb2b65e1ad3596dce9df921ffcc68a9d205134e01819
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_plugins
 *
 * @copyright   (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Plugins\Administrator\Controller;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Plugins display controller.
 *
 * @since  1.5
 */
class DisplayController extends BaseController
{
    /**
     * The default view.
     *
     * @var    string
     * @since  1.6
     */
    protected $default_view = 'plugins';

    /**
     * Method to display a view.
     *
     * @param   boolean  $cachable   If true, the view output will be cached
     * @param   array    $urlparams  An array of safe URL parameters and their variable types.
     *                   @see        \Joomla\CMS\Filter\InputFilter::clean() for valid values.
     *
     * @return  static|boolean   This object to support chaining or false on failure.
     *
     * @since   1.5
     */
    public function display($cachable = false, $urlparams = [])
    {
        $view   = $this->input->get('view', 'plugins');
        $layout = $this->input->get('layout', 'default');
        $id     = $this->input->getInt('extension_id');

        // Check for edit form.
        if ($view == 'plugin' && $layout == 'edit' && !$this->checkEditId('com_plugins.edit.plugin', $id)) {
            // Somehow the person just went to the form - we don't allow that.
            if (!\count($this->app->getMessageQueue())) {
                $this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
            }

            $this->setRedirect(Route::_('index.php?option=com_plugins&view=plugins', false));

            return false;
        }

        return parent::display($cachable, $urlparams);
    }
}

The same content is in 152 releases, Joomla 5.0.0-alpha4 to 6.2.1-rc1. See them all, or every version of this file.