- md5
- c991f1e897c1b36e1b7af933624e49a4
- sha1
- 45844478235322070bec4795cd594a9ad71251ec
- sha256
- f2d837caeb4d164c110e6c83ec0622a3fee2a7c6d2f98b1faf5ca3fe3e0df57f
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Templates\Administrator\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
/**
* Templates manager master display controller.
*
* @since 1.6
*/
class DisplayController extends BaseController
{
/**
* @var string The default view.
* @since 1.6
*/
protected $default_view = 'styles';
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
*
* @return static|boolean This object to support chaining or false on failure.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$view = $this->input->get('view', 'styles');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
// For JSON requests
if ($this->app->getDocument()->getType() == 'json')
{
return parent::display();
}
// Check for edit form.
if ($view == 'style' && $layout == 'edit' && !$this->checkEditId('com_templates.edit.style', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(Route::_('index.php?option=com_templates&view=styles', false));
return false;
}
return parent::display();
}
}
The same content is in 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.