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 2012-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 2012-2014 Horde LLC
 10:  * @license   http://www.horde.org/licenses/gpl GPL
 11:  * @package   IMP
 12:  */
 13: 
 14: /**
 15:  * Mailbox page for dynamic view.
 16:  *
 17:  * @author    Michael Slusarz <slusarz@horde.org>
 18:  * @category  Horde
 19:  * @copyright 2012-2014 Horde LLC
 20:  * @license   http://www.horde.org/licenses/gpl GPL
 21:  * @package   IMP
 22:  */
 23: class IMP_Dynamic_Mailbox extends IMP_Dynamic_Base
 24: {
 25:     /**
 26:      */
 27:     protected function _init()
 28:     {
 29:         global $injector, $page_output, $registry, $session;
 30: 
 31:         $page_output->addScriptFile('dimpbase.js');
 32:         $page_output->addScriptFile('passphrase.js');
 33:         $page_output->addScriptFile('viewport.js');
 34:         $page_output->addScriptFile('external/tinycon.js');
 35:         $page_output->addScriptFile('dragdrop2.js', 'horde');
 36:         $page_output->addScriptFile('form_ghost.js', 'horde');
 37:         $page_output->addScriptFile('jstorage.js', 'horde');
 38:         $page_output->addScriptFile('slider2.js', 'horde');
 39:         $page_output->addScriptFile('toggle_quotes.js', 'horde');
 40:         $page_output->addScriptPackage('Horde_Core_Script_Package_Dialog');
 41:         $page_output->addScriptPackage('IMP_Script_Package_Imp');
 42: 
 43:         $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
 44: 
 45:         if ($imp_imap->access(IMP_Imap::ACCESS_FLAGS)) {
 46:             $page_output->addScriptFile('colorpicker.js', 'horde');
 47:             $this->view->picker_img = Horde_Themes_Image::tag('colorpicker.png', array('alt' => _("Color Picker")));
 48:         }
 49: 
 50:         if ($imp_imap->access(IMP_Imap::ACCESS_REMOTE)) {
 51:             $page_output->addScriptFile('external/base64.js');
 52:         }
 53: 
 54:         $this->_addMailboxVars();
 55: 
 56:         $this->view->show_innocent = !empty($imp_imap->config->innocent_params);
 57:         $this->view->show_search = $imp_imap->access(IMP_Imap::ACCESS_SEARCH);
 58:         $this->view->show_spam = !empty($imp_imap->config->spam_params);
 59: 
 60:         $impSubinfo = new Horde_View(array(
 61:             'templatePath' => IMP_TEMPLATES . '/dynamic'
 62:         ));
 63:         $impSubinfo->addHelper('Text');
 64:         $impSubinfo->quota = (bool)$imp_imap->config->quota;
 65: 
 66:         $topbar = $injector->getInstance('Horde_View_Topbar');
 67:         $topbar->search = $this->view->show_search;
 68:         $topbar->searchMenu = true;
 69:         $topbar->subinfo = $impSubinfo->render('mailbox_subinfo');
 70:         $page_output->topbar = true;
 71: 
 72:         $blank = new Horde_Url();
 73:         $impSidebar = new Horde_View(array(
 74:             'templatePath' => array(
 75:                 $registry->get('templates', 'horde') . '/sidebar',
 76:                 IMP_TEMPLATES . '/dynamic'
 77:             )
 78:         ));
 79:         $impSidebar->addHelper('Text');
 80:         $impSidebar->containers = array(
 81:             array(
 82:                 'id' => 'imp-specialmboxes'
 83:             )
 84:         );
 85:         if ($imp_imap->isImap()) {
 86:             $impSidebar->containers[] = array(
 87:                 'rows' => array(
 88:                     array(
 89:                         'id' => 'folderopts_link',
 90:                         'cssClass' => 'folderoptsImg',
 91:                         'link' => $blank->link() . _("Folder Actions") . '</a>'
 92:                     ),
 93:                     array(
 94:                         'id' => 'dropbase',
 95:                         'style' => 'display:none',
 96:                         'cssClass' => 'folderImg',
 97:                         'link' => $blank->link() . _("Move to Base Level") . '</a>'
 98:                     )
 99:                 )
100:             );
101:             $impSidebar->containers[] = array(
102:                 'id' => 'imp-normalmboxes'
103:             );
104:         }
105: 
106:         $sidebar = $injector->getInstance('Horde_View_Sidebar');
107:         $sidebar->newLink = $blank->link(array('id' => 'composelink',
108:                                                'class' => 'icon'));
109:         $sidebar->newText = _("New Message");
110:         $sidebar->content = $impSidebar->render('sidebar');
111: 
112:         $this->view->sidebar = $sidebar->render();
113: 
114:         $this->view->max_fsize = intval($session->get('imp', 'file_upload'));
115: 
116:         $page_output->noDnsPrefetch();
117: 
118:         $this->_pages[] = 'mailbox';
119:     }
120: 
121:     /**
122:      */
123:     public static function url(array $opts = array())
124:     {
125:         return Horde::url('dynamic.php')->add('page', 'mailbox');
126:     }
127: 
128:     /**
129:      */
130:     protected function _addMailboxVars()
131:     {
132:         global $conf, $injector, $prefs, $registry;
133: 
134:         /* Does server support ACLs? */
135:         $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
136:         $acl = $imp_imap->access(IMP_Imap::ACCESS_ACL);
137: 
138:         $subscribe = $prefs->getValue('subscribe');
139: 
140:         $this->js_conf += array_filter(array(
141:             // URLs
142:             'URI_LISTINFO' => strval(IMP_Basic_Listinfo::url()->setRaw(true)),
143:             'URI_MESSAGE' => strval(IMP_Dynamic_Message::url()->setRaw(true)),
144:             'URI_PORTAL' => strval($registry->getServiceLink('portal')->setRaw(true)),
145:             'URI_PREFS_IMP' => strval($registry->getServiceLink('prefs', 'imp')->setRaw(true)),
146:             'URI_SEARCH' => strval(IMP_Basic_Search::url()->setRaw(true)),
147:             'URI_THREAD' => strval(IMP_Basic_Thread::url()->setRaw(true)),
148: 
149:             // IMAP Flags
150:             'FLAG_DELETED' => Horde_Imap_Client::FLAG_DELETED,
151:             'FLAG_DRAFT' => Horde_Imap_Client::FLAG_DRAFT,
152:             'FLAG_INNOCENT' => Horde_Imap_Client::FLAG_NOTJUNK,
153:             'FLAG_SEEN' => Horde_Imap_Client::FLAG_SEEN,
154:             'FLAG_SPAM' => Horde_Imap_Client::FLAG_JUNK,
155: 
156:             // Message list templates
157:             'msglist_template_horiz' => file_get_contents(IMP_TEMPLATES . '/dynamic/msglist_horiz.html'),
158:             'msglist_template_vert' => file_get_contents(IMP_TEMPLATES . '/dynamic/msglist_vert.html'),
159: 
160:             // Other variables
161:             'acl' => $acl,
162:             'filter_any' => intval($prefs->getValue('filter_any_mailbox')),
163:             'from_link' => intval($prefs->getValue('from_link') == 0),
164:             'fsearchid' => IMP_Mailbox::formTo(IMP_Search::MBOX_PREFIX . IMP_Search::DIMP_FILTERSEARCH),
165:             'initial_page' => is_null($initial_page = IMP::getInitialPage()->mbox) ? null : $initial_page->form_to,
166:             'mbox_expand' => intval($prefs->getValue('nav_expanded') == 2),
167:             'name' => $registry->get('name', 'imp'),
168:             'poll_alter' => intval(!$prefs->isLocked('nav_poll') && !$prefs->getValue('nav_poll_all')),
169:             'qsearchid' => IMP_Mailbox::formTo(IMP_Search::MBOX_PREFIX . IMP_Search::DIMP_QUICKSEARCH),
170:             'refresh_time' => intval($prefs->getValue('refresh_time')),
171:             'sidebar_width' => max(intval($prefs->getValue('sidebar_width')), 150),
172:             'sort' => array(
173:                 'from' => array(
174:                     'c' => 'msgFrom',
175:                     't' => _("From"),
176:                     'v' => Horde_Imap_Client::SORT_FROM
177:                 ),
178:                 'to' => array(
179:                     'c' => 'msgFrom',
180:                     'ec' => 'msgFromTo',
181:                     't' => _("To"),
182:                     'v' => Horde_Imap_Client::SORT_TO
183:                 ),
184:                 'subject' => array(
185:                     'c' => 'msgSubject',
186:                     't' => _("Subject"),
187:                     'v' => Horde_Imap_Client::SORT_SUBJECT
188:                 ),
189:                 'thread' => array(
190:                     'c' => 'msgSubject',
191:                     'v' => Horde_Imap_Client::SORT_THREAD
192:                 ),
193:                 'date' => array(
194:                     'c' => 'msgDate',
195:                     't' => _("Date"),
196:                     'v' => IMP::IMAP_SORT_DATE
197:                 ),
198:                 'msgarrival' => array(
199:                     'c' => 'msgDate',
200:                     'v' => Horde_Imap_Client::SORT_ARRIVAL
201:                 ),
202:                 'msgdate' => array(
203:                     'c' => 'msgDate',
204:                     'v' => Horde_Imap_Client::SORT_DATE
205:                 ),
206:                 'sequence' => array(
207:                     'v' => Horde_Imap_Client::SORT_SEQUENCE
208:                 ),
209:                 'size' => array(
210:                     'c' => 'msgSize',
211:                     't' => _("Size"),
212:                     'v' => Horde_Imap_Client::SORT_SIZE
213:                 )
214:             ),
215:             'subscribe' => intval($subscribe)
216:         ));
217: 
218:         $context = array(
219:             'ctx_container' => array(
220:                 '_mbox' => '',
221:                 '_sep1' => null,
222:                 'create' => _("Create subfolder"),
223:                 'rename' => _("Rename"),
224:                 'delete' => _("Delete subfolders"),
225:                 '_sep2' => null,
226:                 'search' => _("Search"),
227:                 '_sep3' => null,
228:                 'expand' => _("Expand All"),
229:                 'collapse' => _("Collapse All")
230:             ),
231:             'ctx_datesort' => array(
232:                 '*msgarrival' => _("Arrival Time"),
233:                 '*msgdate' => _("Message Date")
234:             ),
235:             'ctx_flag' => array(),
236:             'ctx_flagunset' => array(),
237:             'ctx_flag_search' => array(),
238:             'ctx_mbox_flag' => array(
239:                 'seen' => _("Seen"),
240:                 'unseen' => _("Unseen")
241:             ),
242:             'ctx_noactions' => array(
243:                 '_mbox' => '',
244:                 '_sep1' => null,
245:                 'noaction' => _("No actions available")
246:             ),
247:             'ctx_remoteauth' => array(
248:                 '_mbox' => '',
249:                 '_sep1' => null,
250:                 'create' => _("Create Mailbox"),
251:                 'logout' => _("Log Out")
252:             ),
253:             'ctx_sortopts' => array(
254:                 'from' => _("From"),
255:                 'to' => _("To"),
256:                 'subject' => _("Subject"),
257:                 'thread' => _("Thread"),
258:                 'msgarrival' => _("Date (Arrival)"),
259:                 'msgdate' => _("Date (Message)"),
260:                 'size' => _("Size"),
261:                 '_sep1' => null,
262:                 'sequence' => _("No Sort")
263:             ),
264:             'ctx_subjectsort' => array(
265:                 'thread' => _("Thread Sort"),
266:             ),
267:             'ctx_template' => array(
268:                 'edit' => _("Edit Template"),
269:                 'new' => _("Create New Template")
270:             ),
271:             'ctx_vcontainer' => array(
272:                 '_mbox' => _("Virtual Folders"),
273:                 '_sep1' => null,
274:                 'edit' => _("Edit Virtual Folders")
275:             ),
276:             'ctx_vfolder' => array(
277:                 '_mbox' => '',
278:                 '_sep1' => null,
279:                 'edit' => _("Edit Virtual Folder"),
280:                 'delete' => _("Delete Virtual Folder")
281:             )
282:         );
283: 
284:         /* Folder options context menu. */
285:         if ($imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
286:             $context['ctx_folderopts'] = array(
287:                 'new' => _("Create Mailbox"),
288:                 'sub' => _("Hide Unsubscribed"),
289:                 'unsub' => _("Show All Mailboxes"),
290:                 'expand' => _("Expand All"),
291:                 'collapse' => _("Collapse All"),
292:                 '_sep1' => null,
293:                 'reload' => _("Rebuild Folder List")
294:             );
295:         }
296: 
297:         if (!$subscribe) {
298:             unset(
299:                 $context['ctx_folderopts']['sub'],
300:                 $context['ctx_folderopts']['unsub']
301:             );
302:         }
303: 
304:         /* Message context menu. */
305:         $context['ctx_message'] = array(
306:             '_sub1' => array(
307:                 'resume' => _("Resume Draft"),
308:                 'template' => _("Use Template"),
309:                 'template_edit' => _("Edit Template"),
310:                 'view' => _("View Message")
311:             ),
312:             'reply' => _("Reply"),
313:             'forward' => _("Forward"),
314:             '_sub2' => array(
315:                 '_sep1' => null,
316:                 'setflag' => _("Mark as") . '...',
317:                 'unsetflag' => _("Unmark as") . '...',
318:             ),
319:             '_sep2' => null,
320:             'spam' => _("Report as Spam"),
321:             'innocent' => _("Report as Innocent"),
322:             'blacklist' => _("Blacklist"),
323:             'whitelist' => _("Whitelist"),
324:             'addfilter' => _("Create Filter"),
325:             'delete' => _("Delete"),
326:             'undelete' => _("Undelete"),
327:             '_sub3' => array(
328:                 '_sep3' => null,
329:                 'source' => _("View Source")
330:             )
331:         );
332: 
333:         if (empty($imp_imap->config->spam_params)) {
334:             unset($context['ctx_message']['spam']);
335:         }
336:         if (empty($imp_imap->config->innocent_params)) {
337:             unset($context['ctx_message']['innocent']);
338:         }
339:         if (!$registry->hasLink('mail/newEmailFilter')) {
340:             unset($context['ctx_message']['addfilter']);
341:         }
342:         if ($prefs->getValue('use_trash')) {
343:             unset($context['ctx_message']['undelete']);
344:         }
345:         if (empty($conf['user']['allow_view_source'])) {
346:             unset($context['ctx_message']['_sub3']);
347:         }
348: 
349:         /* Mailbox context menu. */
350:         $context['ctx_mbox'] = array(
351:             '_mbox' => '',
352:             '_sep1' => null,
353:             'create' => _("Create subfolder"),
354:             'rename' => _("Rename"),
355:             'empty' => _("Empty"),
356:             'delete' => _("Delete"),
357:             '_sep2' => null,
358:             'setflag' => _("Mark all as"),
359:             '_sep3' => null,
360:             'poll' => _("Check for New Mail"),
361:             'nopoll' => _("Do Not Check for New Mail"),
362:             'sub' => _("Subscribe"),
363:             'unsub' => _("Unsubscribe"),
364:             '_sep4' => null,
365:             'search' => _("Search"),
366:             '_sub1' => array(
367:                 '_sep5' => null,
368:                 'expand' => _("Expand All"),
369:                 'collapse' => _("Collapse All")
370:             ),
371:             '_sep6' => null,
372:             'export' => _("Export"),
373:             'import' => _("Import"),
374:             '_sep7' => null,
375:             'size' => _("Mailbox Size"),
376:             '_sub2' => array(
377:                 '_sep8' => null,
378:                 'acl' => _("Edit ACL")
379:             ),
380:         );
381: 
382:         if (!$subscribe) {
383:             unset(
384:                 $context['ctx_mbox']['sub'],
385:                 $context['ctx_mbox']['unsub']
386:             );
387:         }
388:         if (!$imp_imap->access(IMP_Imap::ACCESS_IMPORT)) {
389:             unset($context['ctx_mbox']['import']);
390:         }
391:         if (!$imp_imap->access(IMP_Imap::ACCESS_FLAGS)) {
392:             unset(
393:                 $context['ctx_mbox']['_sep2'],
394:                 $context['ctx_mbox']['setflag'],
395:                 $context['ctx_mbox']['_sep3'],
396:                 $context['ctx_mbox']['poll'],
397:                 $context['ctx_mbox']['nopoll']
398:             );
399:         }
400:         if (!$imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
401:             unset(
402:                 $context['ctx_mbox']['_sep7'],
403:                 $context['ctx_mbox']['size']
404:             );
405:         }
406:         if (!$imp_imap->access(IMP_Imap::ACCESS_SEARCH)) {
407:             unset(
408:                 $context['ctx_mbox']['_sep4'],
409:                 $context['ctx_mbox']['search']
410:             );
411:         }
412: 
413:         /* Other Actions context menu. */
414:         $context['ctx_oa'] = array(
415:             'preview_hide' => _("Hide Preview"),
416:             'preview_show' => _("Show Preview"),
417:             'layout_horiz' => _("Horizontal Layout"),
418:             'layout_vert' => _("Vertical Layout"),
419:             '_sub1' => array(
420:                 '_sep1' => null,
421:                 'setflag' => _("Mark as") . '...',
422:                 'unsetflag' => _("Unmark as") . '...',
423:             ),
424:             'blacklist' => _("Blacklist"),
425:             'whitelist' => _("Whitelist"),
426:             '_sub2' => array(
427:                 '_sep2' => null,
428:                 'purge_deleted' => _("Purge Deleted"),
429:                 'undelete' => _("Undelete")
430:             ),
431:             'show_deleted' => _("Show Deleted"),
432:             'hide_deleted' => _("Hide Deleted"),
433:             '_sub3' => array(
434:                 '_sep3' => null,
435:                 'clear_sort' => _("Clear Sort")
436:             )
437:         );
438:         if ($prefs->getValue('use_trash')) {
439:             unset($context['ctx_oa']['_sub2']);
440:         }
441:         if ($prefs->isLocked('delhide')) {
442:             unset($context['ctx_oa']['hide_deleted']);
443:         }
444: 
445:         /* Shared between message and other actions menus. */
446:         if (!$registry->hasMethod('mail/blacklistFrom')) {
447:             unset(
448:                 $context['ctx_message']['blacklist'],
449:                 $context['ctx_oa']['blacklist']
450:             );
451:         }
452:         if (!$registry->hasMethod('mail/whitelistFrom')) {
453:             unset(
454:                 $context['ctx_message']['whitelist'],
455:                 $context['ctx_oa']['whitelist']
456:             );
457:         }
458: 
459:         /* Preview context menu. */
460:         $context['ctx_preview'] = array(
461:             'save' => _("Save"),
462:             'viewsource' => _("View Source"),
463:             'allparts' => _("All Parts"),
464:             'thread' => _("View Thread"),
465:             'listinfo' => _("List Info")
466:         );
467: 
468:         if (empty($conf['user']['allow_view_source'])) {
469:             unset($context['ctx_preview']['viewsource']);
470:         }
471: 
472:         /* Search related context menus. */
473:         if ($imp_imap->access(IMP_Imap::ACCESS_SEARCH)) {
474:             $context['ctx_filteropts'] = array(
475:                 '*filter' => _("Filter By"),
476:                 '*flag' => _("Show Only"),
477:                 '*flagnot' => _("Don't Show")
478:             );
479:             if (IMP_Filter::canApplyFilters()) {
480:                 $context['ctx_filteropts']['_sub1'] = array(
481:                     '_sep1' => null,
482:                     'applyfilters' => _("Apply Filters")
483:                 );
484:             }
485: 
486:             $context['ctx_qsearchopts'] = array(
487:                 '*all' => _("Entire Message"),
488:                 '*body' => _("Body"),
489:                 '*from' => _("From"),
490:                 '*recip' => _("Recipients (To/Cc/Bcc)"),
491:                 '*subject' => _("Subject"),
492:                 '_sep1' => null,
493:                 '*advanced' => _("Advanced Search...")
494:             );
495:             /* Generate filter array. */
496:             $iterator = IMP_Search_IteratorFilter::create(
497:                 IMP_Search_IteratorFilter::FILTER
498:             );
499: 
500:             $context['ctx_filter'] = array();
501:             foreach ($iterator as $val) {
502:                 if ($val->enabled) {
503:                     $context['ctx_filter']['*' . $val->id] = $val->label;
504:                 }
505:             }
506:         }
507: 
508:         /* Remote accounts context menu. */
509:         if ($imp_imap->access(IMP_Imap::ACCESS_REMOTE)) {
510:             $context['ctx_rcontainer'] = array(
511:                 '*prefs' => _("Manage Remote Accounts")
512:             );
513:         }
514: 
515:         $this->js_context = array_merge($context, $this->js_context);
516: 
517:         $this->js_text += array(
518:             'badaddr' => _("Invalid Address"),
519:             'badsubject' => _("Invalid Subject"),
520:             'baselevel' => _("base level of the folder tree"),
521:             'check' => _("Checking..."),
522:             'copyto' => _("Copy %s to %s"),
523:             'create_prompt' => _("Create mailbox:"),
524:             'createsub_prompt' => _("Create subfolder of %s:"),
525:             'delete_mbox' => _("Permanently delete %s?"),
526:             'download_mbox' => _("All messages in this mailbox will be downloaded into the format that you choose. Depending on the size of the mailbox, this action may take awhile."),
527:             'empty_mbox' => _("Permanently delete all %d messages in %s?"),
528:             'import_mbox' => _("Mbox or .eml file:"),
529:             'import_mbox_loading' => _("Importing (this may take some time)..."),
530:             'listmsg_wait' => _("The server is still generating the message list."),
531:             'listmsg_timeout' => _("The server was unable to generate the message list."),
532:             'loading' => _("Loading..."),
533:             'message_0' => _("No messages"),
534:             'message_1' => _("1 message"),
535:             'message_2' => _("%d messages"),
536:             'mboxsize' => _("%s is: %s."),
537:             'moveto' => _("Move %s to %s"),
538:             'newflag_name' => _("Flag Name:"),
539:             'newflag_wait' => _("Creating New Flag..."),
540:             'onlogout' => _("Logging Out..."),
541:             'portal' => _("Portal"),
542:             'prefs' => _("User Options"),
543:             'remote_password' => _("Password for %s:"),
544:             'rename_prompt' => _("Rename %s to:"),
545:             'search' => _("Search"),
546:             'search_input' => _("Search (%s)"),
547:             'search_time' => _("Results are %d Minutes Old"),
548:             'selected' => _("%s selected."),
549:             'slidertext' => _("Messages %d - %d"),
550:             'vfolder' => _("Virtual Folder: %s"),
551:             'vp_empty' => _("There are no messages in this mailbox."),
552:             'vp_empty_search' => _("No messages matched the search query.")
553:         );
554: 
555:         if ($subscribe) {
556:             $this->js_text += array(
557:                 'subscribe_mbox' => _("Subscribe to %s?"),
558:                 'subscribe_mbox_subfolders' => _("Subscribe to all subfolders of %s?"),
559:                 'unsubscribe_mbox' => _("Unsubscribe to %s?"),
560:                 'unsubscribe_mbox_subfolders' => _("Unsubscribe to all subfolders of %s?"),
561:             );
562:         }
563:     }
564: 
565: }
566: 
API documentation generated by ApiGen