Overview

Packages

  • IMP

Classes

  • IMP
  • IMP_Ajax_Addresses
  • IMP_Ajax_Application
  • IMP_Ajax_Application_Compose
  • IMP_Ajax_Application_Handler_Common
  • IMP_Ajax_Application_Handler_ComposeAttach
  • IMP_Ajax_Application_Handler_Draft
  • IMP_Ajax_Application_Handler_Dynamic
  • IMP_Ajax_Application_Handler_ImageUnblock
  • IMP_Ajax_Application_Handler_Mboxtoggle
  • IMP_Ajax_Application_Handler_Passphrase
  • IMP_Ajax_Application_Handler_Remote
  • IMP_Ajax_Application_Handler_RemotePrefs
  • IMP_Ajax_Application_Handler_Search
  • IMP_Ajax_Application_Handler_Smartmobile
  • IMP_Ajax_Application_ListMessages
  • IMP_Ajax_Application_ShowMessage
  • IMP_Ajax_Application_Viewport
  • IMP_Ajax_Application_Viewport_Error
  • IMP_Ajax_Imple_ImportEncryptKey
  • IMP_Ajax_Imple_ItipRequest
  • IMP_Ajax_Imple_PassphraseDialog
  • IMP_Ajax_Imple_VcardImport
  • IMP_Ajax_Queue
  • IMP_Api
  • IMP_Application
  • IMP_Auth
  • IMP_Basic_Base
  • IMP_Basic_Compose
  • IMP_Basic_Contacts
  • IMP_Basic_Error
  • IMP_Basic_Folders
  • IMP_Basic_Listinfo
  • IMP_Basic_Mailbox
  • IMP_Basic_Message
  • IMP_Basic_Pgp
  • IMP_Basic_Saveimage
  • IMP_Basic_Search
  • IMP_Basic_Searchbasic
  • IMP_Basic_Smime
  • IMP_Basic_Thread
  • IMP_Block_Newmail
  • IMP_Block_Summary
  • IMP_Compose
  • IMP_Compose_Attachment
  • IMP_Compose_Attachment_Linked_Metadata
  • IMP_Compose_Attachment_Metadata
  • IMP_Compose_Attachment_Storage
  • IMP_Compose_Attachment_Storage_AutoDetermine
  • IMP_Compose_Attachment_Storage_Temp
  • IMP_Compose_Attachment_Storage_VfsLinked
  • IMP_Compose_Exception
  • IMP_Compose_Exception_Address
  • IMP_Compose_HtmlSignature
  • IMP_Compose_Link
  • IMP_Compose_LinkedAttachment
  • IMP_Compose_Ui
  • IMP_Compose_View
  • IMP_Contacts
  • IMP_Contacts_Avatar_Addressbook
  • IMP_Contacts_Avatar_Gravatar
  • IMP_Contacts_Avatar_Unknown
  • IMP_Contacts_Flag_Host
  • IMP_Contacts_Image
  • IMP_Contents
  • IMP_Contents_InlineOutput
  • IMP_Contents_View
  • IMP_Crypt_Pgp
  • IMP_Crypt_Smime
  • IMP_Dynamic_AddressList
  • IMP_Dynamic_Base
  • IMP_Dynamic_Compose
  • IMP_Dynamic_Compose_Common
  • IMP_Dynamic_Helper_Base
  • IMP_Dynamic_Mailbox
  • IMP_Dynamic_Message
  • IMP_Exception
  • IMP_Factory_AuthImap
  • IMP_Factory_Compose
  • IMP_Factory_ComposeAtc
  • IMP_Factory_Contacts
  • IMP_Factory_Contents
  • IMP_Factory_Flags
  • IMP_Factory_Ftree
  • IMP_Factory_Identity
  • IMP_Factory_Imap
  • IMP_Factory_Mail
  • IMP_Factory_MailAutoconfig
  • IMP_Factory_Mailbox
  • IMP_Factory_MailboxCache
  • IMP_Factory_MailboxList
  • IMP_Factory_Maillog
  • IMP_Factory_MimeViewer
  • IMP_Factory_Pgp
  • IMP_Factory_PrefsSort
  • IMP_Factory_Quota
  • IMP_Factory_Search
  • IMP_Factory_Sentmail
  • IMP_Factory_Smime
  • IMP_Factory_Spam
  • IMP_Filter
  • IMP_Flag_Base
  • IMP_Flag_Imap
  • IMP_Flag_Imap_Answered
  • IMP_Flag_Imap_Deleted
  • IMP_Flag_Imap_Draft
  • IMP_Flag_Imap_Flagged
  • IMP_Flag_Imap_Forwarded
  • IMP_Flag_Imap_Junk
  • IMP_Flag_Imap_NotJunk
  • IMP_Flag_Imap_Seen
  • IMP_Flag_System_Attachment
  • IMP_Flag_System_Encrypted
  • IMP_Flag_System_HighPriority
  • IMP_Flag_System_List
  • IMP_Flag_System_LowPriority
  • IMP_Flag_System_Match_Address
  • IMP_Flag_System_Match_Flag
  • IMP_Flag_System_Match_Header
  • IMP_Flag_System_Personal
  • IMP_Flag_System_Signed
  • IMP_Flag_System_Unseen
  • IMP_Flag_User
  • IMP_Flags
  • IMP_Ftree
  • IMP_Ftree_Account
  • IMP_Ftree_Account_Imap
  • IMP_Ftree_Account_Inboxonly
  • IMP_Ftree_Account_Remote
  • IMP_Ftree_Account_Vfolder
  • IMP_Ftree_Element
  • IMP_Ftree_Eltdiff
  • IMP_Ftree_Iterator
  • IMP_Ftree_Iterator_Ancestors
  • IMP_Ftree_IteratorFilter
  • IMP_Ftree_IteratorFilter_Children
  • IMP_Ftree_IteratorFilter_Containers
  • IMP_Ftree_IteratorFilter_Expanded
  • IMP_Ftree_IteratorFilter_Invisible
  • IMP_Ftree_IteratorFilter_Mailboxes
  • IMP_Ftree_IteratorFilter_Nonimap
  • IMP_Ftree_IteratorFilter_Polled
  • IMP_Ftree_IteratorFilter_Remote
  • IMP_Ftree_IteratorFilter_Special
  • IMP_Ftree_IteratorFilter_Subscribed
  • IMP_Ftree_IteratorFilter_Vfolder
  • IMP_Ftree_Prefs
  • IMP_Ftree_Prefs_Expanded
  • IMP_Ftree_Prefs_Poll
  • IMP_Ftree_Select
  • IMP_Images
  • IMP_Imap
  • IMP_Imap_Acl
  • IMP_Imap_Cache_Wrapper
  • IMP_Imap_Config
  • IMP_Imap_Exception
  • IMP_Imap_Password
  • IMP_Imap_PermanentFlags
  • IMP_Imap_Remote
  • IMP_Indices
  • IMP_Indices_Mailbox
  • IMP_LoginTasks_SystemTask_GarbageCollection
  • IMP_LoginTasks_SystemTask_Upgrade
  • IMP_LoginTasks_SystemTask_UpgradeAuth
  • IMP_LoginTasks_Task_Autocreate
  • IMP_LoginTasks_Task_DeleteAttachmentsMonthly
  • IMP_LoginTasks_Task_DeleteSentmailMonthly
  • IMP_LoginTasks_Task_FilterOnLogin
  • IMP_LoginTasks_Task_PurgeSentmail
  • IMP_LoginTasks_Task_PurgeSpam
  • IMP_LoginTasks_Task_PurgeTrash
  • IMP_LoginTasks_Task_RecoverDraft
  • IMP_LoginTasks_Task_RenameSentmailMonthly
  • IMP_Mailbox
  • IMP_Mailbox_List
  • IMP_Mailbox_List_Pop3
  • IMP_Mailbox_List_Thread
  • IMP_Mailbox_List_Virtual
  • IMP_Mailbox_SessionCache
  • IMP_Mailbox_Ui
  • IMP_Maillog
  • IMP_Maillog_Log_Base
  • IMP_Maillog_Log_Forward
  • IMP_Maillog_Log_Mdn
  • IMP_Maillog_Log_Redirect
  • IMP_Maillog_Log_Reply
  • IMP_Maillog_Log_Replyall
  • IMP_Maillog_Log_Replylist
  • IMP_Maillog_Message
  • IMP_Maillog_Storage_Base
  • IMP_Maillog_Storage_Composite
  • IMP_Maillog_Storage_History
  • IMP_Maillog_Storage_Mdnsent
  • IMP_Maillog_Storage_Null
  • IMP_Mbox_Generate
  • IMP_Mbox_Import
  • IMP_Mbox_Size
  • IMP_Message
  • IMP_Message_Date
  • IMP_Message_Ui
  • IMP_Mime_Headers
  • IMP_Mime_Status
  • IMP_Mime_Status_RenderIssue
  • IMP_Mime_Status_RenderIssue_Display
  • IMP_Mime_Viewer_Alternative
  • IMP_Mime_Viewer_Appledouble
  • IMP_Mime_Viewer_Audio
  • IMP_Mime_Viewer_Enriched
  • IMP_Mime_Viewer_Externalbody
  • IMP_Mime_Viewer_Html
  • IMP_Mime_Viewer_Images
  • IMP_Mime_Viewer_Itip
  • IMP_Mime_Viewer_Mdn
  • IMP_Mime_Viewer_Partial
  • IMP_Mime_Viewer_Pdf
  • IMP_Mime_Viewer_Pgp
  • IMP_Mime_Viewer_Plain
  • IMP_Mime_Viewer_Related
  • IMP_Mime_Viewer_Rfc822
  • IMP_Mime_Viewer_Smil
  • IMP_Mime_Viewer_Smime
  • IMP_Mime_Viewer_Status
  • IMP_Mime_Viewer_Vcard
  • IMP_Mime_Viewer_Video
  • IMP_Mime_Viewer_Zip
  • IMP_Minimal_Base
  • IMP_Minimal_Compose
  • IMP_Minimal_Error
  • IMP_Minimal_Folders
  • IMP_Minimal_Mailbox
  • IMP_Minimal_Message
  • IMP_Minimal_Messagepart
  • IMP_Minimal_Search
  • IMP_Notification_Event_Status
  • IMP_Notification_Handler_Decorator_ImapAlerts
  • IMP_Notification_Handler_Decorator_NewmailNotify
  • IMP_Perms
  • IMP_Prefs_AttribText
  • IMP_Prefs_Identity
  • IMP_Prefs_Sort
  • IMP_Prefs_Sort_FixedDate
  • IMP_Prefs_Sort_None
  • IMP_Prefs_Sort_Sortpref
  • IMP_Prefs_Sort_Sortpref_Locked
  • IMP_Prefs_Special_Acl
  • IMP_Prefs_Special_ComposeTemplates
  • IMP_Prefs_Special_Drafts
  • IMP_Prefs_Special_Encrypt
  • IMP_Prefs_Special_Flag
  • IMP_Prefs_Special_HtmlSignature
  • IMP_Prefs_Special_ImageReplacement
  • IMP_Prefs_Special_InitialPage
  • IMP_Prefs_Special_Mailto
  • IMP_Prefs_Special_NewmailSound
  • IMP_Prefs_Special_PgpPrivateKey
  • IMP_Prefs_Special_PgpPublicKey
  • IMP_Prefs_Special_Remote
  • IMP_Prefs_Special_Searches
  • IMP_Prefs_Special_Sentmail
  • IMP_Prefs_Special_SmimePrivateKey
  • IMP_Prefs_Special_SmimePublicKey
  • IMP_Prefs_Special_Sourceselect
  • IMP_Prefs_Special_Spam
  • IMP_Prefs_Special_SpecialMboxes
  • IMP_Prefs_Special_Trash
  • IMP_Quota
  • IMP_Quota_Hook
  • IMP_Quota_Imap
  • IMP_Quota_Null
  • IMP_Quota_Ui
  • IMP_Remote
  • IMP_Remote_Account
  • IMP_Script_Package_Autocomplete
  • IMP_Script_Package_ComposeBase
  • IMP_Script_Package_DynamicBase
  • IMP_Script_Package_Editor
  • IMP_Script_Package_Imp
  • IMP_Search
  • IMP_Search_Element
  • IMP_Search_Element_Attachment
  • IMP_Search_Element_Autogenerated
  • IMP_Search_Element_Bulk
  • IMP_Search_Element_Contacts
  • IMP_Search_Element_Daterange
  • IMP_Search_Element_Flag
  • IMP_Search_Element_Header
  • IMP_Search_Element_Mailinglist
  • IMP_Search_Element_Or
  • IMP_Search_Element_Personal
  • IMP_Search_Element_Recipient
  • IMP_Search_Element_Size
  • IMP_Search_Element_Text
  • IMP_Search_Element_Within
  • IMP_Search_Filter
  • IMP_Search_Filter_Attachment
  • IMP_Search_Filter_Autogenerated
  • IMP_Search_Filter_Builtin
  • IMP_Search_Filter_Bulk
  • IMP_Search_Filter_Contacts
  • IMP_Search_Filter_Mailinglist
  • IMP_Search_Filter_Personal
  • IMP_Search_IteratorFilter
  • IMP_Search_Query
  • IMP_Search_Ui
  • IMP_Search_Vfolder
  • IMP_Search_Vfolder_Builtin
  • IMP_Search_Vfolder_Vinbox
  • IMP_Search_Vfolder_Vtrash
  • IMP_Sentmail
  • IMP_Sentmail_Mongo
  • IMP_Sentmail_Null
  • IMP_Sentmail_Sql
  • IMP_Smartmobile
  • IMP_Spam
  • IMP_Spam_Email
  • IMP_Spam_Null
  • IMP_Spam_Program
  • IMP_Test
  • IMP_Tree_Flist
  • IMP_Tree_Jquerymobile
  • IMP_Tree_Simplehtml
  • IMP_View_Subinfo

Interfaces

  • IMP_Compose_Attachment_Linked
  • IMP_Contacts_Avatar_Backend
  • IMP_Contacts_Flag_Backend
  • IMP_Spam_Base
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Copyright 1999-2014 Horde LLC (http://www.horde.org/)
  4:  *
  5:  * See the enclosed file COPYING for license information (GPL). If you
  6:  * did not receive this file, see http://www.horde.org/licenses/gpl.
  7:  *
  8:  * @category  Horde
  9:  * @copyright 1999-2014 Horde LLC
 10:  * @license   http://www.horde.org/licenses/gpl GPL
 11:  * @package   IMP
 12:  */
 13: 
 14: /**
 15:  * Basic view message page.
 16:  *
 17:  * @author    Chuck Hagenbuch <chuck@horde.org>
 18:  * @author    Michael Slusarz <slusarz@horde.org>
 19:  * @category  Horde
 20:  * @copyright 1999-2014 Horde LLC
 21:  * @license   http://www.horde.org/licenses/gpl GPL
 22:  * @package   IMP
 23:  */
 24: class IMP_Basic_Message extends IMP_Basic_Base
 25: {
 26:     /**
 27:      */
 28:     protected function _init()
 29:     {
 30:         global $conf, $injector, $notification, $page_output, $prefs, $registry, $session;
 31: 
 32:         $mailbox = $this->indices->mailbox;
 33:         $imp_imap = $mailbox->imp_imap;
 34: 
 35:         /* We know we are going to be exclusively dealing with this mailbox,
 36:          * so select it on the IMAP server (saves some STATUS calls). Open R/W
 37:          * to clear the RECENT flag. */
 38:         $imp_imap->openMailbox($mailbox, Horde_Imap_Client::OPEN_READWRITE);
 39: 
 40:         /* Make sure we have a valid index. */
 41:         $imp_mailbox = $mailbox->list_ob;
 42:         $imp_mailbox->setIndex($this->indices);
 43:         if (!$imp_mailbox->isValidIndex()) {
 44:             $this->_returnToMailbox(null, 'message_missing');
 45:             return;
 46:         }
 47: 
 48:         $imp_flags = $injector->getInstance('IMP_Flags');
 49:         $imp_identity = $injector->getInstance('IMP_Identity');
 50:         $imp_message = $injector->getInstance('IMP_Message');
 51:         $imp_ui = $injector->getInstance('IMP_Message_Ui');
 52: 
 53:         /* Run through action handlers. */
 54:         if ($this->vars->actionID) {
 55:             try {
 56:                 $session->getToken($this->vars->token);
 57:             } catch (Horde_Exception $e) {
 58:                 $notification->push($e);
 59:                 $this->vars->actionID = null;
 60:             }
 61:         }
 62: 
 63:         $readonly = $mailbox->readonly;
 64:         $peek = false;
 65: 
 66:         switch ($this->vars->actionID) {
 67:         case 'blacklist':
 68:         case 'whitelist':
 69:             if ($this->vars->actionID == 'blacklist') {
 70:                 $injector->getInstance('IMP_Filter')->blacklistMessage($this->indices);
 71:             } else {
 72:                 $injector->getInstance('IMP_Filter')->whitelistMessage($this->indices);
 73:             }
 74:             break;
 75: 
 76:         case 'delete_message':
 77:             $imp_message->delete(
 78:                 $this->indices,
 79:                 array('mailboxob' => $imp_mailbox)
 80:             );
 81:             if ($prefs->getValue('mailbox_return')) {
 82:                 $this->_returnToMailbox($imp_mailbox->getIndex());
 83:                 return;
 84:             }
 85:             if ($imp_ui->moveAfterAction($mailbox)) {
 86:                 $imp_mailbox->setIndex(1);
 87:             }
 88:             break;
 89: 
 90:         case 'undelete_message':
 91:             $imp_message->undelete($this->indices);
 92:             break;
 93: 
 94:         case 'move_message':
 95:         case 'copy_message':
 96:             if (isset($this->vars->targetMbox) &&
 97:                 (!$readonly || ($this->vars->actionID == 'copy_message'))) {
 98:                 if ($this->vars->newMbox) {
 99:                     $targetMbox = IMP_Mailbox::prefFrom($this->vars->targetMbox);
100:                     $newMbox = true;
101:                 } else {
102:                     $targetMbox = IMP_Mailbox::formFrom($this->vars->targetMbox);
103:                     $newMbox = false;
104:                 }
105:                 $imp_message->copy(
106:                     $targetMbox,
107:                     ($this->vars->actionID == 'move_message') ? 'move' : 'copy',
108:                     $this->indices,
109:                     array(
110:                         'create' => $newMbox,
111:                         'mailboxob' => $imp_mailbox
112:                     )
113:                 );
114:                 if ($prefs->getValue('mailbox_return')) {
115:                     $this->_returnToMailbox($imp_mailbox->getIndex());
116:                     return;
117:                 }
118:             }
119:             break;
120: 
121:         case 'innocent_report':
122:         case 'spam_report':
123:             $res = $injector->getInstance('IMP_Factory_Spam')->create(
124:                 ($this->vars->actionID == 'spam_report') ? IMP_Spam::SPAM : IMP_Spam::INNOCENT
125:             )->report(
126:                 $this->indices,
127:                 array('mailbox' => $imp_mailbox)
128:             );
129:             switch ($res) {
130:             case 1:
131:                 if ($imp_ui->moveAfterAction($mailbox)) {
132:                     $imp_mailbox->setIndex(1);
133:                 }
134:                 break;
135:             }
136:             if ($prefs->getValue('mailbox_return')) {
137:                 $this->_returnToMailbox($imp_mailbox->getIndex());
138:                 return;
139:             }
140:             break;
141: 
142:         case 'flag_message':
143:             if (!$readonly &&
144:                 isset($this->vars->flag) &&
145:                 count($this->indices)) {
146:                 $peek = true;
147:                 $flag = $imp_flags->parseFormId($this->vars->flag);
148:                 $imp_message->flag(array(
149:                     ($flag['set'] ? 'add' : 'remove') => array($flag['flag'])
150:                 ), $this->indices);
151:                 if ($prefs->getValue('mailbox_return')) {
152:                     $this->_returnToMailbox($imp_mailbox->getIndex());
153:                     return;
154:                 }
155:             }
156:             break;
157: 
158:         case 'add_address':
159:             try {
160:                 $contact_link = $injector->getInstance('IMP_Contacts')->addAddress($this->vars->address, $this->vars->name);
161:                 $notification->push(sprintf(_("Entry \"%s\" was successfully added to the address book"), $contact_link), 'horde.success', array('content.raw'));
162:             } catch (Horde_Exception $e) {
163:                 $notification->push($e);
164:             }
165:             break;
166: 
167:         case 'strip_all':
168:         case 'strip_attachment':
169:             if (!$readonly) {
170:                 try {
171:                     $this->indices = new IMP_Indices_Mailbox(
172:                         $this->indices->mailbox,
173:                         $imp_message->stripPart(
174:                             $this->indices,
175:                             ($this->vars->actionID == 'strip_all') ? null : $this->vars->imapid,
176:                             array(
177:                                 'mailboxob' => $imp_mailbox
178:                             )
179:                         )
180:                     );
181:                     $notification->push(_("Attachment successfully stripped."), 'horde.success');
182:                 } catch (Horde_Exception $e) {
183:                     $notification->push($e);
184:                 }
185:             }
186:             break;
187:         }
188: 
189:         /* We may have done processing that has taken us past the end of the
190:          * message array, so we will return to the mailbox. */
191:         if (!$imp_mailbox->isValidIndex()) {
192:             $this->_returnToMailbox(count($imp_mailbox));
193:             return;
194:         }
195: 
196:         /* Now that we are done processing, get the index and array index of
197:          * the current message. */
198:         $msg_index = $imp_mailbox[$imp_mailbox->getIndex()];
199: 
200:         /* Parse the message. */
201:         try {
202:             $imp_contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($imp_mailbox));
203:         } catch (IMP_Exception $e) {
204:             $imp_mailbox->removeMsgs(true);
205:             $this->_returnToMailbox(null, 'message_missing');
206:             return;
207:         }
208: 
209:         /* Get envelope/flag/header information. */
210:         try {
211:             /* Need to fetch flags before HEADERTEXT, because SEEN flag might
212:              * be set before we can grab it. */
213:             $query = new Horde_Imap_Client_Fetch_Query();
214:             $query->flags();
215:             $flags_ret = $imp_imap->fetch($msg_index['m'], $query, array(
216:                 'ids' => $imp_imap->getIdsOb($msg_index['u'])
217:             ));
218: 
219:             $query = new Horde_Imap_Client_Fetch_Query();
220:             $query->envelope();
221:             $fetch_ret = $imp_imap->fetch($msg_index['m'], $query, array(
222:                 'ids' => $imp_imap->getIdsOb($msg_index['u'])
223:             ));
224:         } catch (IMP_Imap_Exception $e) {
225:             $this->_returnToMailbox(null, 'message_missing');
226:             return;
227:         }
228: 
229:         $envelope = $fetch_ret->first()->getEnvelope();
230:         $flags = $flags_ret->first()->getFlags();
231:         $mime_headers = $peek
232:             ? $imp_contents->getHeader()
233:             : $imp_contents->getHeaderAndMarkAsSeen();
234: 
235:         /* Get the title/mailbox label of the mailbox page. */
236:         $page_label = $mailbox->label;
237: 
238:         /* Generate the link to ourselves. */
239:         $buid = $imp_mailbox->getBuid($msg_index['m'], $msg_index['u']);
240:         $msgindex = $imp_mailbox->getIndex();
241:         $message_url = Horde::url('basic.php')->add('page', 'message');
242:         $token = $session->getToken();
243:         $self_link = self::url(array(
244:             'buid' => $buid,
245:             'mailbox' => $mailbox
246:         ))->add(array(
247:             'token' => $token,
248:             'start' => $msgindex
249:         ));
250: 
251:         /* Develop the list of headers to display. */
252:         $basic_headers = $imp_ui->basicHeaders();
253:         $display_headers = $msgAddresses = array();
254: 
255:         $date_ob = new IMP_Message_Date($envelope->date);
256:         if ($format_date = $date_ob->format($date_ob::DATE_LOCAL)) {
257:             $display_headers['date'] = $format_date;
258:         }
259: 
260:         /* Build From address links. */
261:         $display_headers['from'] = $imp_ui->buildAddressLinks($envelope->from, $self_link);
262: 
263:         /* Add country/flag image. */
264:         if (!empty($envelope->from)) {
265:             $contacts_img = new IMP_Contacts_Image($envelope->from[0]);
266:             try {
267:                 $res = $contacts_img->getImage($contacts_img::FLAG);
268:                 $display_headers['from'] .= '&nbsp;' . Horde_Themes_Image::tag(
269:                     $res['url'],
270:                     array(
271:                         'alt' => $res['desc'],
272:                         'fullsrc' => true
273:                     )
274:                 );
275:             } catch (IMP_Exception $e) {}
276:         }
277: 
278:         /* Look for Face information. */
279:         if ($face = $mime_headers->getValue('face')) {
280:             $display_headers['from'] .= '&nbsp;<img src="' .
281:                 Horde_Url_Data::create('image/png', base64_decode($face))
282:                 . '">';
283:         }
284: 
285:         /* Build To/Cc/Bcc links. */
286:         foreach (array('to', 'cc', 'bcc') as $val) {
287:             $msgAddresses[] = $mime_headers->getValue($val);
288:             if (($val == 'to') || count($envelope->$val)) {
289:                 $display_headers[$val] = $imp_ui->buildAddressLinks($envelope->$val, $self_link);
290:             }
291:         }
292: 
293:         /* Process the subject now. */
294:         if ($subject = $mime_headers->getValue('subject')) {
295:             $this->title = sprintf(_("%s: %s"), $page_label, $subject);
296:             $shortsub = Horde_String::truncate($subject, 100);
297:         } else {
298:             $shortsub = _("[No Subject]");
299:             $this->title = sprintf(_("%s: %s"), $page_label, $shortsub);
300:         }
301: 
302:         /* See if the priority has been set. */
303:         switch ($injector->getInstance('IMP_Mime_Headers')->getPriority($mime_headers)) {
304:         case 'high':
305:             $basic_headers['priority'] = _("Priority");
306:             $display_headers['priority'] = '<div class="iconImg msgflags flagHighpriority" title="' . htmlspecialchars(_("High Priority")) . '"></div>&nbsp;' . _("High");
307:             break;
308: 
309:         case 'low':
310:             $basic_headers['priority'] = _("Priority");
311:             $display_headers['priority'] = '<div class="iconImg msgflags flagLowpriority" title="' . htmlspecialchars(_("Low Priority")) . '"></div>&nbsp;' . _("Low");
312:             break;
313:         }
314: 
315:         /* Build Reply-To address link. */
316:         if (!empty($envelope->reply_to) &&
317:             ($envelope->from[0]->bare_address != $envelope->reply_to[0]->bare_address)  &&
318:             ($reply_to = $imp_ui->buildAddressLinks($envelope->reply_to, $self_link))) {
319:             $display_headers['reply-to'] = $reply_to;
320:         }
321: 
322:         /* Determine if all/list/user-requested headers needed. */
323:         $all_headers = $this->vars->show_all_headers;
324:         $user_hdrs = $imp_ui->getUserHeaders();
325: 
326:         /* Check for the presence of mailing list information. */
327:         $list_info = $imp_ui->getListInformation($mime_headers);
328: 
329:         /* Display all headers or, optionally, the user-specified headers for
330:          * the current identity. */
331:         $full_headers = array();
332:         if ($all_headers) {
333:             $header_array = $mime_headers->toArray();
334:             foreach ($header_array as $head => $val) {
335:                 $lc_head = strtolower($head);
336: 
337:                 /* Skip the header if we have already dealt with it. */
338:                 if (!isset($display_headers[$lc_head]) &&
339:                     (!in_array($lc_head, array('importance', 'x-priority')) ||
340:                     !isset($display_headers['priority']))) {
341:                     $full_headers[$lc_head] = $val;
342:                 }
343:             }
344:         } elseif (!empty($user_hdrs)) {
345:             foreach ($user_hdrs as $user_hdr) {
346:                 $user_val = $mime_headers->getValue($user_hdr);
347:                 if (!empty($user_val)) {
348:                     $full_headers[$user_hdr] = $user_val;
349:                 }
350:             }
351:         }
352:         ksort($full_headers);
353: 
354:         /* For the self URL link, we can't trust the index in the query string
355:          * as it may have changed if we deleted/copied/moved messages. We may
356:          * need other stuff in the query string, so we need to do an
357:          * add/remove of uid info. */
358:         $selfURL = $mailbox->url(Horde::selfUrlParams()->remove(array('actionID')), $buid)->add('token', $token);
359:         $headersURL = $selfURL->copy()->remove(array('show_all_headers'));
360: 
361:         /* Generate previous/next links. */
362:         $prev_msg = $imp_mailbox[$imp_mailbox->getIndex() - 1];
363:         if ($prev_msg) {
364:             $prev_url = self::url(array(
365:                 'buid' => $imp_mailbox->getBuid($prev_msg['m'], $prev_msg['u']),
366:                 'mailbox' => $mailbox
367:             ))->setRaw(true);
368:             $page_output->addLinkTag(array(
369:                 'href' => $prev_url,
370:                 'id' => 'prev',
371:                 'rel' => 'Previous',
372:                 'type' => null
373:             ));
374:         } else {
375:             $prev_url = null;
376:         }
377: 
378:         $next_msg = $imp_mailbox[$imp_mailbox->getIndex() + 1];
379:         if ($next_msg) {
380:             $next_url = self::url(array(
381:                 'buid' => $imp_mailbox->getBuid($next_msg['m'], $next_msg['u']),
382:                 'mailbox' => $mailbox
383:             ))->setRaw(true);
384:             $page_output->addLinkTag(array(
385:                 'href' => $next_url,
386:                 'id' => 'next',
387:                 'rel' => 'Next',
388:                 'type' => null
389:             ));
390:         } else {
391:             $next_url = null;
392:         }
393: 
394:         /* Generate the mailbox link. */
395:         $mailbox_url = $mailbox->url('mailbox')->add('start', $msgindex);
396: 
397:         /* Everything below here is related to preparing the output. */
398: 
399:         $js_vars = array(
400:             'ImpMessage.text' => array(
401:                 'innocent_report' => _("Are you sure you wish to report this message as innocent?"),
402:                 'moveconfirm' => _("Are you sure you want to move the message(s)? (Some message information might get lost, like message headers, text formatting or attachments!)"),
403:                 'newmbox' => _("You are copying/moving to a new mailbox.") . "\n" . _("Please enter a name for the new mailbox:") . "\n",
404:                 'spam_report' => _("Are you sure you wish to report this message as spam?"),
405:                 'target_mbox' => _("You must select a target mailbox first.")
406:             )
407:         );
408: 
409:         /* Set the status information of the message. */
410:         $msgAddresses[] = $mime_headers->getValue('from');
411:         $identity = $match_identity = $imp_identity->getMatchingIdentity($msgAddresses);
412:         if (is_null($identity)) {
413:             $identity = $imp_identity->getDefault();
414:         }
415: 
416:         $flag_parse = $imp_flags->parse(array(
417:             'flags' => $flags,
418:             'personal' => $match_identity
419:         ));
420: 
421:         $status = '';
422:         foreach ($flag_parse as $val) {
423:             if ($val instanceof IMP_Flag_User) {
424:                 $status .= '<span class="' . $val->css . '" style="' . ($val->bgdefault ? '' : 'background:' . htmlspecialchars($val->bgcolor) . ';') . 'color:' . htmlspecialchars($val->fgcolor) . '">' . htmlspecialchars($val->label) . '</span>';
425:             } else {
426:                 $status .= $val->span;
427:             }
428:         }
429: 
430:         /* If this is a search mailbox, display a link to the parent mailbox
431:          * of the message in the header. */
432:         $h_page_label = htmlspecialchars($page_label);
433:         $header_label = $h_page_label;
434:         if ($mailbox->search) {
435:             $header_label .= ' [' . $msg_index['m']->url('mailbox')->link() . $msg_index['m']->display_html . '</a>]';
436:         }
437: 
438:         /* Prepare the navbar top template. */
439:         $view = new Horde_View(array(
440:             'templatePath' => IMP_TEMPLATES . '/basic/message'
441:         ));
442:         $view->addHelper('FormTag');
443:         $view->addHelper('Tag');
444: 
445:         $t_view = clone $view;
446:         $t_view->buid = $buid;
447:         $t_view->message_url = $message_url;
448:         $t_view->mailbox = $mailbox->form_to;
449:         $t_view->start = $msgindex;
450:         $t_view->token = $token;
451: 
452:         /* Prepare the navbar navigate template. */
453:         $n_view = clone $view;
454:         $n_view->readonly = $readonly;
455:         $n_view->id = 1;
456: 
457:         if ($mailbox->access_flags) {
458:             $n_view->mailbox = $mailbox->form_to;
459: 
460:             $args = array(
461:                 'imap' => true,
462:                 'mailbox' => $mailbox
463:             );
464: 
465:             $form_set = $form_unset = array();
466:             foreach ($imp_flags->getList($args) as $val) {
467:                 if ($val->canset) {
468:                     $form_set[] = array(
469:                         'f' => $val->form_set,
470:                         'l' => $val->label
471:                     );
472:                     $form_unset[] = array(
473:                         'f' => $val->form_unset,
474:                         'l' => $val->label
475:                     );
476:                 }
477:             }
478: 
479:             $n_view->flaglist_set = $form_set;
480:             $n_view->flaglist_unset = $form_unset;
481:         }
482: 
483:         if ($imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
484:             $n_view->move = Horde::widget(array(
485:                 'url' => '#',
486:                 'class' => 'moveAction',
487:                 'title' => _("Move"),
488:                 'nocheck' => true
489:             ));
490:             $n_view->copy = Horde::widget(array(
491:                 'url' => '#',
492:                 'class' => 'copyAction',
493:                 'title' => _("Copy"),
494:                 'nocheck' => true
495:             ));
496: 
497:             $iterator = new IMP_Ftree_IteratorFilter(
498:                 $injector->getInstance('IMP_Ftree')
499:             );
500:             $iterator->add($iterator::NONIMAP);
501: 
502:             $n_view->options = new IMP_Ftree_Select(array(
503:                 'heading' => _("This message to"),
504:                 'inc_tasklists' => true,
505:                 'inc_notepads' => true,
506:                 'iterator' => $iterator,
507:                 'new_mbox' => true
508:             ));
509:         }
510: 
511:         $n_view->back_to = Horde::widget(array(
512:             'url' => $mailbox_url,
513:             'title' => sprintf(_("Bac_k to %s"), $h_page_label),
514:             'nocheck' => true
515:         ));
516: 
517:         if ($prev_url) {
518:             $n_view->prev = Horde::link($prev_url, _("Previous Message"));
519:             $n_view->prev_img = 'navleftImg';
520:         } else {
521:             $n_view->prev_img = 'navleftgreyImg';
522:         }
523: 
524:         if ($next_url) {
525:             $n_view->next = Horde::link($next_url, _("Next Message"));
526:             $n_view->next_img = 'navrightImg';
527:         } else {
528:             $n_view->next_img = 'navrightgreyImg';
529:         }
530: 
531:         /* Prepare the navbar actions template. */
532:         $a_view = clone $view;
533:         $compose_params = array(
534:             'buid' => $buid,
535:             'identity' => $identity,
536:             'mailbox' => IMP_Mailbox::formTo($mailbox),
537:         );
538:         if (!$prefs->getValue('compose_popup')) {
539:             $compose_params['start'] = $msgindex;
540:         }
541: 
542:         if ($msg_index['m']->access_deletemsgs) {
543:             if (in_array(Horde_Imap_Client::FLAG_DELETED, $flags)) {
544:                 $a_view->delete = Horde::widget(array(
545:                     'url' => $self_link->copy()->add('actionID', 'undelete_message'),
546:                     'title' => _("Undelete"),
547:                     'nocheck' => true
548:                 ));
549:             } else {
550:                 $a_view->delete = Horde::widget(array(
551:                     'url' => $self_link->copy()->add('actionID', 'delete_message'),
552:                     'title' => _("_Delete"),
553:                     'nocheck' => true
554:                 ));
555:                 if (!$msg_index['m']->is_imap) {
556:                     $js_vars['ImpMessage.pop3delete'] = _("Are you sure you want to PERMANENTLY delete these messages?");
557:                 }
558:             }
559:         }
560: 
561:         $disable_compose = !IMP_Compose::canCompose();
562: 
563:         if (!$disable_compose) {
564:             $clink_ob = new IMP_Compose_Link();
565:             $clink = $clink_ob->link()->add($compose_params);
566: 
567:             $a_view->reply = Horde::widget(array(
568:                 'url' => $clink->add(array('actionID' => 'reply_auto')),
569:                 'class' => 'horde-hasmenu',
570:                 'title' => _("_Reply"),
571:                 'nocheck' => true
572:             ));
573:             $a_view->reply_sender = Horde::widget(array(
574:                 'url' => $clink->add(array('actionID' => 'reply')),
575:                 'title' => _("To Sender"),
576:                 'nocheck' => true
577:             ));
578: 
579:             if ($list_info['reply_list']) {
580:                 $a_view->reply_list = Horde::widget(array(
581:                     'url' => $clink->add(array('actionID' => 'reply_list')),
582:                     'title' => _("To _List"),
583:                     'nocheck' => true
584:                 ));
585:             }
586: 
587:             $addr_ob = clone $envelope->to;
588:             $addr_ob->add($envelope->cc);
589:             $addr_ob->setIteratorFilter(0, $imp_identity->getAllFromAddresses());
590: 
591:             if (count($addr_ob)) {
592:                 $a_view->show_reply_all = Horde::widget(array(
593:                     'url' => $clink->add(array('actionID' => 'reply_all')),
594:                     'title' => _("To _All"),
595:                     'nocheck' => true
596:                 ));
597:             }
598: 
599:             $fwd_locked = $prefs->isLocked('forward_default');
600:             $a_view->forward = Horde::widget(array(
601:                 'url' => $clink->add(array('actionID' => 'forward_auto')),
602:                 'class' => $fwd_locked ? '' : ' horde-hasmenu',
603:                 'title' => _("Fo_rward"),
604:                 'nocheck' => true
605:             ));
606:             if (!$fwd_locked) {
607:                 $a_view->forward_attach = Horde::widget(array(
608:                     'url' => $clink->add(array('actionID' => 'forward_attach')),
609:                     'title' => _("As Attachment"),
610:                     'nocheck' => true
611:                 ));
612:                 $a_view->forward_body = Horde::widget(array(
613:                     'url' => $clink->add(array('actionID' => 'forward_body')),
614:                     'title' => _("In Body Text"),
615:                     'nocheck' => true
616:                 ));
617:                 $a_view->forward_both = Horde::widget(array(
618:                     'url' => $clink->add(array('actionID' => 'forward_both')),
619:                     'title' => _("Attachment and Body Text"),
620:                     'nocheck' => true
621:                 ));
622:             }
623: 
624:             $a_view->redirect = Horde::widget(array(
625:                 'url' => $clink->add(array('actionID' => 'redirect_compose')),
626:                 'title' => _("Redirec_t"),
627:                 'nocheck' => true
628:             ));
629: 
630:             $a_view->editasnew = Horde::widget(array(
631:                 'url' => $clink->add(array('actionID' => 'editasnew')),
632:                 'title' => _("Edit as New"),
633:                 'nocheck' => true
634:             ));
635:         }
636: 
637:         if ($mailbox->access_sortthread) {
638:             $a_view->show_thread = Horde::widget(array(
639:                 'url' => $mailbox->url(IMP_Basic_Thread::url(), $buid)->add(array('start' => $msgindex)),
640:                 'title' => _("_View Thread"),
641:                 'nocheck' => true
642:             ));
643:         }
644: 
645:         if (!$readonly && $registry->hasMethod('mail/blacklistFrom')) {
646:             $a_view->blacklist = Horde::widget(array(
647:                 'url' => $self_link->copy()->add('actionID', 'blacklist'),
648:                 'title' => _("_Blacklist"),
649:                 'nocheck' => true
650:             ));
651:         }
652: 
653:         if (!$readonly && $registry->hasMethod('mail/whitelistFrom')) {
654:             $a_view->whitelist = Horde::widget(array(
655:                 'url' => $self_link->copy()->add('actionID', 'whitelist'),
656:                 'title' => _("_Whitelist"),
657:                 'nocheck' => true
658:             ));
659:         }
660: 
661:         if (!empty($conf['user']['allow_view_source'])) {
662:             $a_view->view_source = $imp_contents->linkViewJS($imp_contents->getMIMEMessage(), 'view_source', _("_Message Source"), array(
663:                 'css' => '',
664:                 'jstext' => _("Message Source"),
665:                 'widget' => true
666:             ));
667:         }
668: 
669:         if (!$disable_compose &&
670:             (in_array(Horde_Imap_Client::FLAG_DRAFT, $flags) || $msg_index['m']->drafts)) {
671:             $a_view->resume = Horde::widget(array(
672:                 'url' => $clink->add(array('actionID' => 'draft')),
673:                 'title' => _("Resume"),
674:                 'nocheck' => true
675:             ));
676:         }
677: 
678:         $imp_params = $mailbox->urlParams($buid);
679:         $a_view->save_as = Horde::widget(array(
680:             'url' => IMP_Contents_View::downloadUrl($subject, array_merge(array('actionID' => 'save_message'), $imp_params)),
681:             'title' => _("Sa_ve as"),
682:             'nocheck' => true
683:         ));
684: 
685:         if ($msg_index['m']->spam_show) {
686:             $a_view->spam = Horde::widget(array(
687:                 'url' => '#',
688:                 'class' => 'spamAction',
689:                 'title' => _("Report as Spam"),
690:                 'nocheck' => true
691:             ));
692:         }
693: 
694:         if ($msg_index['m']->innocent_show) {
695:             $a_view->innocent = Horde::widget(array(
696:                 'url' => '#',
697:                 'class' => 'innocentAction',
698:                 'title' => _("Report as Innocent"),
699:                 'nocheck' => true
700:             ));
701:         }
702: 
703:         if (!$disable_compose) {
704:             $a_view->redirect = Horde::widget(array(
705:                 'url' => $clink->add(array('actionID' => 'redirect_compose')),
706:                 'title' => _("Redirec_t"),
707:                 'nocheck' => true
708:             ));
709:         }
710: 
711:         $a_view->headers = Horde::widget(array(
712:             'url' => '#',
713:             'class' => 'horde-hasmenu',
714:             'title' => _("Headers"),
715:             'nocheck' => true
716:         ));
717:         if ($all_headers) {
718:             $a_view->common_headers = Horde::widget(array(
719:                 'url' => $headersURL,
720:                 'title' => _("Show Common Headers"),
721:                 'nocheck' => true
722:             ));
723:         }
724:         if (!$all_headers) {
725:             $a_view->all_headers = Horde::widget(array(
726:                 'url' => $headersURL->copy()->add('show_all_headers', 1),
727:                 'title' => _("Show All Headers"),
728:                 'nocheck' => true
729:             ));
730:         }
731:         if ($list_info['exists']) {
732:             $a_view->list_headers = Horde::widget(array(
733:                 'onclick' => Horde::popupJs(IMP_Basic_Listinfo::url(array(
734:                                  'buid' => $buid,
735:                                  'mailbox' => $mailbox
736:                              )), array(
737:                                  'urlencode' => true
738:                              )),
739:                 'title' => _("Show Mailing List Information"),
740:                 'nocheck' => true
741:             ));
742:         }
743: 
744:         $hdrs = array();
745: 
746:         /* Prepare the main message template. */
747:         if (!$all_headers) {
748:             foreach ($display_headers as $head => $val) {
749:                 $hdrs[] = array(
750:                     'name' => $basic_headers[$head],
751:                     'val' => $val
752:                 );
753:             }
754:         }
755:         foreach ($full_headers as $head => $val) {
756:             if (is_array($val)) {
757:                 $hdrs[] = array(
758:                     'name' => $head,
759:                     'val' => '<ul style="margin:0;padding-left:15px"><li>' . implode("</li>\n<li>", array_map('htmlspecialchars', $val)) . '</li></ul>'
760:                 );
761:             } else {
762:                 $hdrs[] = array(
763:                     'name' => $head,
764:                     'val' => htmlspecialchars($val)
765:                 );
766:             }
767:         }
768: 
769:         /* Determine the fields that will appear in the MIME info entries. */
770:         $part_info = $part_info_display = array('icon', 'description', 'size');
771:         $part_info_action = array('download', 'download_zip', 'img_save', 'strip');
772:         $part_info_bodyonly = array('print');
773: 
774:         $show_parts = isset($this->vars->show_parts)
775:             ? $this->vars->show_parts
776:             : $prefs->getValue('parts_display');
777: 
778:         $part_info_display = array_merge($part_info_display, $part_info_action, $part_info_bodyonly);
779:         $contents_mask = IMP_Contents::SUMMARY_BYTES |
780:             IMP_Contents::SUMMARY_SIZE |
781:             IMP_Contents::SUMMARY_ICON |
782:             IMP_Contents::SUMMARY_DESCRIP_LINK |
783:             IMP_Contents::SUMMARY_DOWNLOAD |
784:             IMP_Contents::SUMMARY_DOWNLOAD_ZIP |
785:             IMP_Contents::SUMMARY_IMAGE_SAVE |
786:             IMP_Contents::SUMMARY_PRINT;
787: 
788:         /* Do MDN processing now. */
789:         $mdntext = $imp_ui->MDNCheck(new IMP_Indices($msg_index['m'], $buid), $mime_headers, $this->vars->mdn_confirm)
790:             ? strval(new IMP_Mime_Status(array(
791:                 _("The sender of this message is requesting a notification from you when you have read this message."),
792:                 sprintf(_("Click %s to send the notification message."), Horde::link($selfURL->copy()->add('mdn_confirm', 1)) . _("HERE") . '</a>')
793:             )))
794:             : '';
795: 
796:         /* Build body text. This needs to be done before we build the
797:          * attachment list that lives in the header. */
798:         $inline_ob = new IMP_Contents_InlineOutput();
799:         $inlineout = $inline_ob->getInlineOutput($imp_contents, array(
800:             'mask' => $contents_mask,
801:             'part_info_display' => $part_info_display,
802:             'show_parts' => $show_parts
803:         ));
804: 
805:         /* Build the Attachments menu. */
806:         $show_atc = false;
807:         switch ($show_parts) {
808:         case 'atc':
809:             $a_view->show_parts_all = Horde::widget(array(
810:                 'url' => $headersURL->copy()->add(array('show_parts' => 'all')),
811:                 'title' => _("Show All Parts"),
812:                 'nocheck' => true
813:             ));
814:             $show_atc = true;
815:             break;
816: 
817:         case 'all':
818:             if ($prefs->getValue('strip_attachments')) {
819:                 $js_vars['ImpMessage.text']['stripwarn'] = _("Are you sure you wish to PERMANENTLY delete this attachment?");
820:             }
821:             break;
822:         }
823: 
824:         if (count($inlineout['atc_parts']) > 2) {
825:             $a_view->download_all = Horde::widget(array(
826:                 'url' => $imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all'),
827:                 'title' => _("Download All Attachments (in .zip file)"),
828:                 'nocheck' => true
829:             ));
830:             if ($prefs->getValue('strip_attachments')) {
831:                 $a_view->strip_all = Horde::widget(array(
832:                     'url' => Horde::selfUrlParams()->add(array(
833:                         'actionID' => 'strip_all',
834:                         'token' => $token
835:                     )),
836:                     'class' => 'stripAllAtc',
837:                     'title' => _("Strip All Attachments"),
838:                     'nocheck' => true
839:                 ));
840:                 $js_vars['ImpMessage.text']['stripallwarn'] = _("Are you sure you want to PERMANENTLY delete all attachments?");
841:             }
842: 
843:             $show_atc = true;
844:         }
845: 
846:         if ($show_atc) {
847:             $a_view->atc = Horde::widget(array(
848:                 'url' => '#',
849:                 'class' => 'horde-hasmenu',
850:                 'title' => _("Attachments"),
851:                 'nocheck' => true
852:             ));
853:         }
854: 
855:         /* Show attachment information in headers? 'atc_parts' will be empty if
856:          * 'parts_display' pref is 'none'. */
857:         if (!empty($inlineout['atc_parts'])) {
858:             if ($show_parts == 'all') {
859:                 $val = $imp_contents->getTree()->getTree(true);
860:             } else {
861:                 $tmp = array();
862: 
863:                 foreach ($inlineout['atc_parts'] as $id) {
864:                     $summary = $imp_contents->getSummary($id, $contents_mask);
865: 
866:                     $tmp[] = '<tr>';
867:                     foreach ($part_info as $val) {
868:                         $tmp[] = '<td>' . $summary[$val] . '</td>';
869:                     }
870:                     $tmp[] = '<td>';
871:                     foreach ($part_info_action as $val) {
872:                         $tmp[] = $summary[$val];
873:                     }
874:                     $tmp[] = '</td></tr>';
875:                 }
876: 
877:                 $val = '<table>' . implode('', $tmp) . '</table>';
878:             }
879: 
880:             $hdrs[] = array(
881:                 'class' => 'msgheaderParts',
882:                 'name' => ($show_parts == 'all') ? _("Parts") : _("Attachments"),
883:                 'val' => $val
884:             );
885:         }
886: 
887:         $m_view = clone $view;
888:         $m_view->label = $shortsub;
889:         $m_view->headers = $hdrs;
890:         $m_view->msgtext = $mdntext . $inlineout['msgtext'];
891: 
892:         $subinfo = new IMP_View_Subinfo(array('mailbox' => $mailbox));
893:         $subinfo->label = $header_label;
894:         $subinfo->value = sprintf(_("(%d of %d)"), $msgindex, count($imp_mailbox)) . $status;
895:         $injector->getInstance('Horde_View_Topbar')->subinfo = $subinfo->render();
896: 
897:         /* Output message page now. */
898:         $page_output->addInlineJsVars($js_vars, array('top' => true));
899:         $page_output->addScriptFile('scriptaculous/effects.js', 'horde');
900:         $page_output->addScriptFile('hordecore.js', 'horde');
901:         $page_output->addScriptFile('message.js');
902:         $page_output->addScriptFile('stripe.js', 'horde');
903:         $page_output->addScriptPackage('IMP_Script_Package_Imp');
904: 
905:         if (!empty($conf['tasklist']['use_notepad']) ||
906:             !empty($conf['tasklist']['use_tasklist'])) {
907:             $page_output->addScriptPackage('Horde_Core_Script_Package_Dialog');
908:         }
909: 
910:         $page_output->noDnsPrefetch();
911: 
912:         Horde::startBuffer();
913:         foreach ($injector->getInstance('IMP_Maillog')->getLog(new IMP_Maillog_Message($this->indices, array('mdn'))) as $val) {
914:             $notification->push($val->message, 'imp.' . $val->action);
915:         }
916:         $this->output = Horde::endBuffer();
917: 
918:         $this->output .= $t_view->render('navbar_top') .
919:             $n_view->render('navbar_navigate') .
920:             $a_view->render('navbar_actions') .
921:             $m_view->render('message') .
922:             $a_view->render('navbar_actions');
923: 
924:         $n_view->id = 2;
925:         $n_view->isbottom = true;
926:         $this->output .= $n_view->render('navbar_navigate');
927:     }
928: 
929:     /**
930:      * @param array $opts  Options:
931:      *   - buid: (string) BUID of message.
932:      *   - mailbox: (string) Mailbox of message.
933:      */
934:     public static function url(array $opts = array())
935:     {
936:         return IMP_Mailbox::get($opts['mailbox'])->url('basic')->add(array(
937:             'buid' => $opts['buid'],
938:             'page' => 'message'
939:         ));
940:     }
941: 
942:     /**
943:      */
944:     protected function _returnToMailbox($start = null, $actID = null)
945:     {
946:         $this->vars->actionID = $actID;
947:         $this->vars->start = $start;
948: 
949:         $ob = new IMP_Basic_Mailbox($this->vars);
950:         $this->output = $ob->output;
951:     }
952: 
953: }
954: 
API documentation generated by ApiGen