- md5
- 151e7c28fc47366a3dba04d5ff617985
- sha1
- 4431bdd57b549756d1f1ffe7ed6318d4db13f463
- sha256
- d09fd7c5991ed931faa6310bb143850bd002a7f66ba4715424cbb95c665cae95
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @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\MVC\Controller\BaseController;
/**
* 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 This object to support chaining.
*
* @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');
$document = \JFactory::getDocument();
// For JSON requests
if ($document->getType() == 'json')
{
/*$view = new \Joomla\Component\Templates\Administrator\View\Style\Json;
// Get/Create the model
$model = new Style;
$view->setModel($model, true);
$view->document = $document;
return $view->display();
*/
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(\JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(\JRoute::_('index.php?option=com_templates&view=styles', false));
return false;
}
return parent::display();
}
}
No other release has this exact content. See every version of this file.