- md5
- 6a2d23a7f48d384c1fa8e78f22d7c764
- sha1
- cb93ff9f9e43d12c4117cfcb34ea10717c247699
- sha256
- dd87db97c121b95436a49bee01c6a55981540a66d92749c788e81f8cec87fba4
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
<?php
/**
* @package Joomla.Administrator
* @subpackage com_mails
*
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Mails\Administrator\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
/**
* Mail templates Controller
*
* @since 4.0.0
*/
class DisplayController extends BaseController
{
/**
* The default view.
*
* @var string
* @since 1.6
*/
protected $default_view = 'templates';
/**
* 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, for valid values see {@link JFilterInput::clean()}.
*
* @return BaseController|boolean This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = array())
{
$view = $this->input->get('view', 'templates');
$layout = $this->input->get('layout', '');
$id = $this->input->getString('template_id');
// Check for edit form.
if ($view == 'template' && $layout == 'edit' && !$this->checkEditId('com_mails.edit.template', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setMessage(Text::sprintf('COM_MAILS_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(Route::_('index.php?option=com_mails&view=templates', 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.