- md5
- 73a50f6fa1e06c3659a8b51ffa9447ac
- sha1
- b941fb06b7f5680bf33cd792862c47f4932cda6f
- sha256
- 11410b67da71ce84436c81e0fa4e242ee950ddfd5558a05d477c8f3f06e2216b
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
<?php
/**
* @version $Id: view.html.php 20196 2011-01-09 02:40:25Z ian $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Messages component
*
* @package Joomla.Administrator
* @subpackage com_messages
* @since 1.6
*/
class MessagesViewMessage extends JView
{
protected $form;
protected $item;
protected $state;
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'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
parent::display($tpl);
$this->addToolbar();
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
if ($this->getLayout() == 'edit') {
JToolBarHelper::title(JText::_('COM_MESSAGES_WRITE_PRIVATE_MESSAGE'), 'new-privatemessage.png');
JToolBarHelper::save('message.save', 'COM_MESSAGES_TOOLBAR_SEND');
JToolBarHelper::cancel('message.cancel','JTOOLBAR_CANCEL');
JToolBarHelper::help('JHELP_COMPONENTS_MESSAGING_WRITE');
} else {
JToolBarHelper::title(JText::_('COM_MESSAGES_VIEW_PRIVATE_MESSAGE'), 'inbox.png');
$sender = JUser::getInstance($this->item->user_id_from);
if ($sender->authorise('core.admin') || $sender->authorise('core.manage','com_messages') && $sender->authorise('core.login.admin')) {
JToolBarHelper::custom('message.reply', 'restore.png', 'restore_f2.png', 'COM_MESSAGES_TOOLBAR_REPLY', false);
}
JToolBarHelper::cancel('message.cancel');
JToolBarHelper::help('JHELP_COMPONENTS_MESSAGING_READ');
}
}
}
The same content is in 7 releases, Joomla 1.6.0 to 1.6.6. See them all, or every version of this file.