- md5
- 94a771a5ffc17bcfcbb4d161710fe1d6
- sha1
- 4a654d5e45023e89da259b4ea6d1c00b3edee5b6
- sha256
- 3caae2aa88403dee5722beade0b65ca94bf888ce926019d06adbd251223cbcf5
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
<?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Messages\Administrator\View\Config;
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
/**
* View to edit messages user configuration.
*
* @since 1.6
*/
class HtmlView extends BaseHtmlView
{
/**
* The \JForm object
*
* @var \JForm
*/
protected $form;
/**
* The active item
*
* @var object
*/
protected $item;
/**
* The model state
*
* @var \JObject
*/
protected $state;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*
* @since 1.6
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new GenericDataException(implode("\n", $errors), 500);
}
// Bind the record to the form.
$this->form->bind($this->item);
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 4.0.0
*/
protected function addToolbar()
{
Factory::getApplication()->input->set('hidemainmenu', true);
ToolbarHelper::title(Text::_('COM_MESSAGES_TOOLBAR_MY_SETTINGS'), 'envelope');
ToolbarHelper::apply('config.save', 'JSAVE');
ToolbarHelper::cancel('config.cancel', 'JCANCEL');
}
}
The same content is in 20 releases, Joomla 4.0.0-rc4 to 4.1.0-beta2. See them all, or every version of this file.