- md5
- e5cba723f17cae1181c32745f08cfb49
- sha1
- fd5e7d3eb8587e54f5cb930ee9999982b3e49829
- sha256
- b27b79a29eff9d7e1ce3009d1e17109df302e200af63a270408c01a6a5e65dc0
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
<?php
/**
* @copyright Copyright (C) 2005 - 2012 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');
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 2.5.0 to 2.5.6. See them all, or every version of this file.