| Joomla! | PHP Cross Reference | Web Portals |
1 <?php 2 /** 3 * @package Joomla.Administrator 4 * @subpackage com_messages 5 * 6 * @copyright Copyright (C) 2005 - 2012 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 JHtml::_('behavior.modal'); 12 13 /** 14 * View class for a list of messages. 15 * 16 * @package Joomla.Administrator 17 * @subpackage com_messages 18 * @since 1.6 19 */ 20 class MessagesViewMessages extends JViewLegacy 21 { 22 protected $items; 23 24 protected $pagination; 25 26 protected $state; 27 28 /** 29 * Display the view 30 */ 31 public function display($tpl = null) 32 { 33 $this->items = $this->get('Items'); 34 $this->pagination = $this->get('Pagination'); 35 $this->state = $this->get('State'); 36 37 // Check for errors. 38 if (count($errors = $this->get('Errors'))) { 39 JError::raiseError(500, implode("\n", $errors)); 40 return false; 41 } 42 43 $this->addToolbar(); 44 $this->sidebar = JHtmlSidebar::render(); 45 parent::display($tpl); 46 } 47 48 /** 49 * Add the page title and toolbar. 50 * 51 * @since 1.6 52 */ 53 protected function addToolbar() 54 { 55 $state = $this->get('State'); 56 $canDo = MessagesHelper::getActions(); 57 58 JToolbarHelper::title(JText::_('COM_MESSAGES_MANAGER_MESSAGES'), 'inbox.png'); 59 60 if ($canDo->get('core.create')) { 61 JToolbarHelper::addNew('message.add'); 62 } 63 64 if ($canDo->get('core.edit.state')) { 65 JToolbarHelper::divider(); 66 JToolbarHelper::publish('messages.publish', 'COM_MESSAGES_TOOLBAR_MARK_AS_READ'); 67 JToolbarHelper::unpublish('messages.unpublish', 'COM_MESSAGES_TOOLBAR_MARK_AS_UNREAD'); 68 } 69 70 if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { 71 JToolbarHelper::divider(); 72 JToolbarHelper::deleteList('', 'messages.delete', 'JTOOLBAR_EMPTY_TRASH'); 73 } elseif ($canDo->get('core.edit.state')) { 74 JToolbarHelper::divider(); 75 JToolbarHelper::trash('messages.trash'); 76 } 77 78 //JToolbarHelper::addNew('module.add'); 79 JToolbarHelper::divider(); 80 $bar = JToolBar::getInstance('toolbar'); 81 JHtml::_('bootstrap.modal', 'collapseModal'); 82 $title = JText::_('COM_MESSAGES_TOOLBAR_MY_SETTINGS'); 83 $dhtml = "<a class=\"btn modal btn-small\" href=\"index.php?option=com_messages&view=config&tmpl=component\" 84 rel=\"{handler:'iframe', size:{x:700,y:300}}\"> 85 <i class=\"icon-cog\" title=\"$title\"></i>$title</a>"; 86 $bar->appendButton('Custom', $dhtml, 'config'); 87 88 if ($canDo->get('core.admin')) { 89 JToolbarHelper::preferences('com_messages'); 90 } 91 92 JToolbarHelper::divider(); 93 JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_INBOX'); 94 } 95 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
title