* @category Horde * @copyright 2007-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP */ class IMP_Block_Newmail extends Horde_Core_Block { /** */ public $updateable = true; /** */ public function __construct($app, $params = array()) { parent::__construct($app, $params); $this->_name = _("Newest Unseen Messages"); } /** */ protected function _params() { return array( 'msgs_shown' => array( 'type' => 'int', 'name' => _("The number of unseen messages to show"), 'default' => 3 ) ); } /** */ protected function _content() { $inbox = IMP_Mailbox::get('INBOX'); /* Filter on INBOX display, if requested. */ $inbox->filterOnDisplay(); $query = new Horde_Imap_Client_Search_Query(); $query->flag(Horde_Imap_Client::FLAG_SEEN, false); $ids = $inbox->runSearchQuery($query, Horde_Imap_Client::SORT_SEQUENCE, 1); $indices = $ids['INBOX']; $html = '
| ' . _("No unread messages") . ' | |
| ' .
$inbox->url('message', $uid)->link() .
'' . htmlspecialchars($from['from'], ENT_QUOTES, 'UTF-8') . ' ' . $subject . ' | ' .
'' . htmlspecialchars($date, ENT_QUOTES, 'UTF-8') . ' |
| ' . $inbox->url('mailbox')->link() . $text . ' | |