Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_messages
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * HTML View class for the Messages component
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_messages
  17.  * @since       1.6
  18.  */
  19. {
  20.     protected $form;
  21.  
  22.     protected $item;
  23.  
  24.     protected $state;
  25.  
  26.     public function display($tpl null)
  27.     {
  28.         $this->form        = $this->get('Form');
  29.         $this->item        = $this->get('Item');
  30.         $this->state    = $this->get('State');
  31.  
  32.         // Check for errors.
  33.         if (count($errors $this->get('Errors')))
  34.         {
  35.             JError::raiseError(500implode("\n"$errors));
  36.             return false;
  37.         }
  38.  
  39.         parent::display($tpl);
  40.         $this->addToolbar();
  41.     }
  42.  
  43.     /**
  44.      * Add the page title and toolbar.
  45.      *
  46.      * @since   1.6
  47.      */
  48.     protected function addToolbar()
  49.     {
  50.         if ($this->getLayout(== 'edit')
  51.         {
  52.             JToolbarHelper::title(JText::_('COM_MESSAGES_WRITE_PRIVATE_MESSAGE')'envelope-opened new-privatemessage');
  53.             JToolbarHelper::save('message.save''COM_MESSAGES_TOOLBAR_SEND');
  54.             JToolbarHelper::cancel('message.cancel');
  55.             JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_WRITE');
  56.         }
  57.         else
  58.         {
  59.             JToolbarHelper::title(JText::_('COM_MESSAGES_VIEW_PRIVATE_MESSAGE')'envelope inbox');
  60.             $sender JUser::getInstance($this->item->user_id_from);
  61.             if ($sender->authorise('core.admin'|| $sender->authorise('core.manage''com_messages'&& $sender->authorise('core.login.admin'))
  62.             {
  63.                 JToolbarHelper::custom('message.reply''redo'null'COM_MESSAGES_TOOLBAR_REPLY'false);
  64.             }
  65.             JToolbarHelper::cancel('message.cancel');
  66.             JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_READ');
  67.         }
  68.     }
  69. }

Documentation generated on Tue, 19 Nov 2013 15:17:40 +0100 by phpDocumentor 1.4.3