当前位置: 首页>>代码示例>>PHP>>正文


PHP IMP_Mailbox::formTo方法代码示例

本文整理汇总了PHP中IMP_Mailbox::formTo方法的典型用法代码示例。如果您正苦于以下问题:PHP IMP_Mailbox::formTo方法的具体用法?PHP IMP_Mailbox::formTo怎么用?PHP IMP_Mailbox::formTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMP_Mailbox的用法示例。


在下文中一共展示了IMP_Mailbox::formTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs;
     $page_output->addScriptFile('prefs/folder.js');
     $page_output->addInlineJsVars(array('ImpFolderPrefs.mboxes.trash' => _("Enter the name for your new trash mailbox.")));
     $imp_search = $injector->getInstance('IMP_Search');
     $trash = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_TRASH);
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('FormTag');
     $view->addHelper('Horde_Core_View_Helper_Label');
     $view->addHelper('Tag');
     $iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
     $iterator->add(array($iterator::NONIMAP, $iterator::REMOTE));
     $iterator->mboxes = array('INBOX');
     $view->flist = new IMP_Ftree_Select(array('iterator' => $iterator, 'new_mbox' => true, 'selected' => $trash));
     $view->nombox = IMP_Mailbox::formTo(self::PREF_NO_MBOX);
     $view->special_use = $this->_getSpecialUse(Horde_Imap_Client::SPECIALUSE_TRASH);
     if (!$prefs->isLocked('vfolder') || $imp_search['vtrash']->enabled) {
         $view->vtrash = IMP_Mailbox::formTo($imp_search->createSearchId('vtrash'));
         if ($trash) {
             $view->vtrash_select = $trash->vtrash;
         }
     }
     return $view->render('trash');
 }
开发者ID:horde,项目名称:horde,代码行数:27,代码来源:Trash.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param array $opts  Optional parameters:
  *   - abbrev: (boolean) Abbreviate long mailbox names by replacing the
  *             middle of the name with '...'?
  *             DEFAULT: Yes
  *   - basename: (boolean)  Use raw basename instead of abbreviated label?
  *               DEFAULT: false
  *   - heading: (string) The label for an empty-value option at the top of
  *              the list.
  *              DEFAULT: ''
  *   - inc_notepads: (boolean) Include user's editable notepads in list?
  *                   DEFAULT: No
  *   - inc_tasklists: (boolean) Include user's editable tasklists in list?
  *                    DEFAULT: No
  *   - inc_vfolder: (boolean) Include user's virtual folders in list?
  *                  DEFAULT: No
  *   - iterator: (Iterator) Tree iterator to use.
  *   - new_mbox: (boolean) Display an option to create a new mailbox?
  *               DEFAULT: No
  *   - optgroup: (boolean) Whether to use <optgroup> elements to group
  *               mailbox types.
  *               DEFAULT: false
  *   - selected: (string) The mailbox to have selected by default.
  *               DEFAULT: None
  */
 public function __construct(array $opts = array())
 {
     global $injector;
     $this->_tree = $injector->getInstance('IMP_Ftree')->createTree(strval(new Horde_Support_Randomid()), array('basename' => !empty($opts['basename']), 'iterator' => empty($opts['iterator']) ? null : $opts['iterator'], 'render_type' => 'IMP_Tree_Flist'));
     if (!empty($opts['selected'])) {
         $this->_tree->addNodeParams(IMP_Mailbox::formTo($opts['selected']), array('selected' => true));
     }
     $this->_tree->setOption($opts);
 }
开发者ID:horde,项目名称:horde,代码行数:36,代码来源:Select.php

示例3: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output;
     $page_output->addScriptFile('prefs/folder.js');
     $page_output->addInlineJsVars(array('ImpFolderPrefs.mboxes.drafts' => _("Enter the name for your new drafts mailbox.")));
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Label');
     $iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
     $iterator->add(array($iterator::NONIMAP, $iterator::REMOTE));
     $iterator->mboxes = array('INBOX');
     $view->flist = new IMP_Ftree_Select(array('basename' => true, 'iterator' => $iterator, 'new_mbox' => true, 'selected' => IMP_Mailbox::getPref(IMP_Mailbox::MBOX_DRAFTS)));
     $view->nombox = IMP_Mailbox::formTo(self::PREF_NO_MBOX);
     $view->special_use = $this->_getSpecialUse(Horde_Imap_Client::SPECIALUSE_DRAFTS);
     return $view->render('drafts');
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:17,代码来源:Drafts.php

示例4: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs;
     if ($prefs->isLocked(IMP_Mailbox::MBOX_TEMPLATES)) {
         return '';
     }
     $page_output->addScriptFile('prefs/folder.js');
     $page_output->addInlineJsVars(array('ImpFolderPrefs.mboxes.templates' => _("Enter the name for your new compose templates mailbox.")));
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Label');
     $iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
     $iterator->add(array($iterator::NONIMAP, $iterator::REMOTE));
     $iterator->mboxes = array('INBOX');
     $view->mbox_flist = new IMP_Ftree_Select(array('iterator' => $iterator, 'new_mbox' => true, 'selected' => IMP_Mailbox::getPref(IMP_Mailbox::MBOX_TEMPLATES)));
     $view->mbox_nomailbox = IMP_Mailbox::formTo(self::PREF_NO_MBOX);
     return $view->render('composetemplates');
 }
开发者ID:horde,项目名称:horde,代码行数:19,代码来源:ComposeTemplates.php

示例5: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $prefs;
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('FormTag');
     $view->addHelper('Horde_Core_View_Helper_Label');
     $view->addHelper('Tag');
     $iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
     $iterator->add($iterator::REMOTE);
     if (!($initial_page = $prefs->getValue('initial_page'))) {
         $initial_page = 'INBOX';
     }
     $view->folder_page = IMP_Mailbox::formTo(IMP::INITIAL_FOLDERS);
     $view->folder_sel = $initial_page == IMP::INITIAL_FOLDERS;
     $view->flist = new IMP_Ftree_Select(array('inc_vfolder' => true, 'iterator' => $iterator, 'selected' => $initial_page));
     return $view->render('initialpage');
 }
开发者ID:horde,项目名称:horde,代码行数:19,代码来源:InitialPage.php

示例6: getTasklists

 /**
  * @return array
  */
 public function getTasklists($notify = false)
 {
     global $conf, $notification, $registry;
     if ($conf['tasklist']['use_tasklist'] && $registry->hasMethod('tasks/listTasklists')) {
         try {
             $lists = $registry->call('tasks/listTasklists', array(false, Horde_Perms::EDIT));
             $out = array();
             foreach ($lists as $key => $val) {
                 $mbox = IMP_Mailbox::formTo(self::TASKLIST_EDIT . $key);
                 $out[$mbox] = $val;
             }
             return $out;
         } catch (Horde_Exception $e) {
             if ($notify) {
                 $notification->push($e);
             }
         }
     }
     return array();
 }
开发者ID:horde,项目名称:horde,代码行数:23,代码来源:Tasklist.php

示例7: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output;
     $page_output->addScriptFile('folderprefs.js');
     $identity = $injector->getInstance('IMP_Identity');
     $js = array();
     foreach ($identity->getAllSentmail(false) as $key => $val) {
         $js[$key] = $val->form_to;
     }
     $page_output->addInlineJsVars(array('ImpFolderPrefs.mboxes' => array('sent_mail' => _("Create a new sent-mail mailbox")), 'ImpFolderPrefs.sentmail' => $js));
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Label');
     $view->default = IMP_Mailbox::formTo(self::PREF_DEFAULT);
     $iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
     $iterator->add($iterator::NONIMAP);
     $iterator->mboxes = array('INBOX');
     $view->flist = new IMP_Ftree_Select(array('basename' => true, 'iterator' => $iterator, 'new_mbox' => true));
     $view->special_use = $this->_getSpecialUse(Horde_Imap_Client::SPECIALUSE_SENT);
     return $view->render('sentmail');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:22,代码来源:Sentmail.php

示例8: getSearchMboxList

 /**
  * Create SELECT list of mailboxes for advanced search page.
  *
  * @param boolean $unsub  Include unsubcribed mailboxes?
  *
  * @return object  Object with the following properties:
  *   - mbox_list: (array) Mapping of mailbox name (key) to display
  *                string (values).
  *   - tree: (IMP_Tree_Flist) Tree object.
  */
 public function getSearchMboxList($unsub = false)
 {
     global $injector, $registry;
     $ob = new stdClass();
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/search'));
     $view->allsearch = IMP_Mailbox::formTo(IMP_Search_Query::ALLSEARCH);
     $ftree = $injector->getInstance('IMP_Ftree');
     $iterator = new IMP_Ftree_IteratorFilter($ftree);
     if ($unsub) {
         $ftree->loadUnsubscribed();
         $iterator->remove($iterator::UNSUB);
     }
     if ($registry->getView() != $registry::VIEW_DYNAMIC) {
         $iterator->add($iterator::REMOTE);
     }
     $ob->tree = $ftree->createTree('imp_search', array('iterator' => $iterator, 'render_params' => array('abbrev' => 0, 'container_select' => true, 'customhtml' => $view->render('search-all'), 'heading' => _("Add search mailbox:")), 'render_type' => 'IMP_Tree_Flist'));
     $mbox_list = array();
     foreach ($iterator as $val) {
         $mbox_ob = $val->mbox_ob;
         $mbox_list[$mbox_ob->form_to] = $mbox_ob->display;
     }
     $ob->mbox_list = $mbox_list;
     return $ob;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:34,代码来源:Ui.php

示例9: getTree

 /**
  * @param boolean $static  Ignored in this driver.
  */
 public function getTree($static = false)
 {
     global $injector;
     $this->_nodes = $this->_tree->getNodes();
     $filter = $injector->createInstance('Horde_Text_Filter');
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/flist'));
     $view->addHelper('FormTag');
     $view->addHelper('Tag');
     $view->optgroup = $this->getOption('optgroup');
     /* Custom HTML. */
     if ($customhtml = $this->getOption('customhtml')) {
         $view->customhtml = $customhtml;
     }
     /* Heading. */
     if (($heading = $this->getOption('heading')) && strlen($heading) > 0) {
         $view->heading = $heading;
     }
     /* New mailbox entry. */
     if ($this->getOption('new_mbox')) {
         $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
         if ($imp_imap->access(IMP_Imap::ACCESS_CREATEMBOX) && $imp_imap->access(IMP_Imap::ACCESS_CREATEMBOX_MAX)) {
             $view->new_mbox = true;
         }
     }
     /* Virtual folders. */
     if ($this->getOption('inc_vfolder')) {
         $iterator = IMP_Search_IteratorFilter::create(IMP_Search_IteratorFilter::VFOLDER);
         $vfolder_list = array();
         foreach ($iterator as $val) {
             $form_to = IMP_Mailbox::formTo($val);
             $vfolder_list[] = array('l' => $filter->filter($val->label, 'space2html', array('encode' => true)), 'sel' => !empty($this->_nodes[$form_to]['selected']), 'v' => $form_to);
         }
         if (!empty($vfolder_list)) {
             $view->vfolder = $vfolder_list;
         }
     }
     /* Add the list of editable tasklists to the list. */
     if ($this->getOption('inc_tasklists')) {
         $tasklist = new IMP_Indices_Copy_Tasklist();
         $view->tasklist = array();
         foreach ($tasklist->getTasklists() as $key => $val) {
             $view->tasklist[] = array('l' => $filter->filter($val->get('name'), 'space2html', array('encode' => true)), 'v' => $key);
         }
     }
     /* Add the list of editable notepads to the list. */
     if ($this->getOption('inc_notepads')) {
         $notepad = new IMP_Indices_Copy_Notepad();
         $view->notepad = array();
         foreach ($notepad->getNotepads() as $key => $val) {
             $view->notepad[] = array('l' => $filter->filter($val->get('name'), 'space2html', array('encode' => true)), 'v' => $key);
         }
     }
     /* Prepare filter list. */
     $this->_filter = ($filter = $this->getOption('filter')) ? array_flip($filter) : array();
     $tree = '';
     foreach ($this->_tree->getRootNodes() as $node_id) {
         $tree .= $this->_buildTree($node_id);
     }
     $view->tree = $tree;
     return $view->render('flist');
 }
开发者ID:horde,项目名称:horde,代码行数:64,代码来源:Flist.php

示例10: _init


//.........这里部分代码省略.........
                     break;
             }
             exit;
         }
     }
     /* Prepare the search view. */
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/search'));
     $view->addHelper('Text');
     $view->addHelper('Tag');
     $view->addHelper('FormTag');
     $view->action = self::url();
     /* Determine if we are editing a search query. */
     $q_ob = $default_mailbox->getSearchOb();
     if ($this->vars->edit_query && $default_mailbox->search) {
         if ($default_mailbox->vfolder) {
             if (!$default_mailbox->editvfolder) {
                 $notification->push(_("Built-in Virtual Folders cannot be edited."), 'horde.error');
                 $registry->getServiceLink('prefs', 'imp')->add('group', 'searches')->redirect();
             }
             $view->edit_query = true;
             $view->edit_query_vfolder = $default_mailbox->form_to;
         } elseif ($imp_search->isFilter($q_ob)) {
             if (!$imp_search->isFilter($q_ob, true)) {
                 $notification->push(_("Built-in Filters cannot be edited."), 'horde.error');
                 $registry->getServiceLink('prefs', 'imp')->add('group', 'searches')->redirect();
             }
             $view->edit_query = true;
             $view->edit_query_filter = $default_mailbox->form_to;
         }
         if ($view->edit_query) {
             $view->search_label = $q_ob->label;
             $js_vars['ImpSearch.prefsurl'] = strval($registry->getServiceLink('prefs', 'imp')->add('group', 'searches')->setRaw(true));
         }
     } else {
         /* Process list of recent searches. */
         $iterator = IMP_Search_IteratorFilter::create(IMP_Search_IteratorFilter::QUERY);
         $rs = array();
         foreach ($iterator as $val) {
             $rs[$val->formid] = array('c' => $val->criteria, 'f' => array('m' => IMP_Mailbox::formTo($val->all ? array(IMP_Search_Query::ALLSEARCH) : array_map('strval', $val->mbox_list)), 's' => IMP_Mailbox::formTo(array_map('strval', $val->subfolder_list))), 'l' => Horde_String::truncate($val->querytext));
         }
         if (!empty($rs)) {
             $js_vars['ImpSearch.i_recent'] = $rs;
         }
         $s_mboxes = IMP_Mailbox::formTo($search_mailbox);
         $js_vars['ImpSearch.i_mboxes'] = array('m' => $this->vars->subfolder ? array() : $s_mboxes, 's' => $this->vars->subfolder ? $s_mboxes : array());
     }
     if ($default_mailbox->search) {
         $js_vars['ImpSearch.i_criteria'] = $q_ob->criteria;
         $js_vars['ImpSearch.i_mboxes'] = array('m' => IMP_Mailbox::formTo($q_ob->all ? array(IMP_Search_Query::ALLSEARCH) : $q_ob->mbox_list), 's' => IMP_Mailbox::formTo($q_ob->subfolder_list));
     }
     /* Create the criteria list. */
     $c_list = $types = array();
     foreach ($criteria as $key => $val) {
         $c_list[] = array('l' => $val['label'], 'v' => $key);
         $types[$key] = $val['type'];
     }
     $view->clist = $c_list;
     /* Create the filter list. These are all-or-nothing searches. */
     $f_list = array();
     foreach ($filters as $key => $val) {
         $f_list[] = array('l' => $val['label'], 'v' => $key);
         $types[$key] = 'filter';
     }
     $view->filterlist = $f_list;
     /* Create the flag list. */
     $flist = $imp_flags->getList(array('imap' => true, 'mailbox' => $default_mailbox));
     $flag_set = array();
     foreach ($flist as $val) {
         $flag_set[] = array('l' => $val->label, 'v' => rawurlencode($val->form_set));
         $types[rawurlencode($val->form_set)] = 'flag';
     }
     $view->flist = $flag_set;
     /* Generate master mailbox list. */
     $mbox_list = array();
     if (!$view->edit_query_filter) {
         $js_vars['ImpSearch.allsearch'] = IMP_Mailbox::formTo(IMP_Search_Query::ALLSEARCH);
         $ob = $injector->getInstance('IMP_Search_Ui')->getSearchMboxList();
         $mbox_list = $ob->mbox_list;
         $view->subscribe = $prefs->getValue('subscribe');
         $view->tree = $ob->tree->getTree();
     }
     /* Prepare the topbar. */
     if (!$dynamic_view) {
         $injector->getInstance('Horde_View_Topbar')->subinfo = $injector->getInstance('IMP_View_Subinfo')->render();
     }
     Horde_Core_Ui_JsCalendar::init();
     $page_output->addScriptFile('hordecore.js', 'horde');
     $page_output->addScriptFile('horde.js', 'horde');
     $page_output->addScriptFile('search.js');
     $page_output->addInlineJsVars(array_merge($js_vars, array('ImpSearch.data' => array('constants' => $constants, 'dynamic_view' => $dynamic_view, 'inbox' => IMP_Mailbox::get('INBOX')->form_to, 'mbox_list' => $mbox_list, 'months' => Horde_Core_Ui_JsCalendar::months(), 'searchmbox' => $default_mailbox->form_to, 'types' => $types), 'ImpSearch.text' => array('and' => _("and"), 'customhdr' => _("Custom Header:"), 'datereset' => _("Date Reset"), 'dateselection' => _("Date Selection"), 'flag' => _("Flag:"), 'loading' => _("Loading..."), 'need_criteria' => _("Please select at least one search criteria."), 'need_date' => _("Need at least one date in the date range search."), 'need_mbox' => _("Please select at least one mailbox to search."), 'need_label' => _("Saved searches require a label."), 'not_match' => _("Do NOT Match"), 'or' => _("OR"), 'search_all' => _("Search All Mailboxes"), 'search_term' => _("Search Term:"), 'subfolder_search' => _("Search all subfolders?"), 'to' => _("to")))), array('onload' => true));
     if ($dynamic_view) {
         if (!$this->vars->edit_query) {
             $view->return_mailbox_val = sprintf(_("Return to %s"), $default_mailbox->display_html);
         }
         $page_output->topbar = $page_output->sidebar = false;
         $this->header_params = array('html_id' => 'htmlAllowScroll');
     }
     $this->title = _("Search");
     $this->output = $view->render('search');
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:101,代码来源:Search.php

示例11: _addFtreeInfo

 /**
  * Add folder tree information.
  *
  * @param IMP_Ajax_Application $ajax  The AJAX object.
  */
 protected function _addFtreeInfo(IMP_Ajax_Application $ajax)
 {
     global $injector;
     $eltdiff = $injector->getInstance('IMP_Ftree')->eltdiff;
     $out = $poll = array();
     if (!$eltdiff->track) {
         return;
     }
     if (($add = $eltdiff->add) && ($elts = array_values(array_filter(array_map(array($this, '_ftreeElt'), $add))))) {
         $out['a'] = $elts;
         $poll = $add;
     }
     if (($change = $eltdiff->change) && ($elts = array_values(array_filter(array_map(array($this, '_ftreeElt'), $change))))) {
         $out['c'] = $elts;
         $poll = array_merge($poll, $change);
     }
     if ($delete = $eltdiff->delete) {
         $out['d'] = IMP_Mailbox::formTo($delete);
     }
     if (!empty($out)) {
         $eltdiff->clear();
         $ajax->addTask('mailbox', array_merge($out, $this->_mailboxOpts));
         $this->poll($poll);
     }
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:30,代码来源:Queue.php

示例12: _addBaseVars

 /**
  * Add base javascript variables to the page.
  */
 protected function _addBaseVars()
 {
     global $injector, $page_output, $prefs;
     $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
     $code = array('conf' => array_filter(array('allow_folders' => $imp_imap->access(IMP_Imap::ACCESS_FOLDERS), 'disable_compose' => !IMP_Compose::canCompose(), 'flags' => array('deleted' => '\\deleted', 'draft' => '\\draft', 'seen' => '\\seen'), 'mailbox_return' => $prefs->getValue('mailbox_return'), 'qsearchid' => IMP_Mailbox::formTo(IMP_Search::MBOX_PREFIX . IMP_Search::DIMP_QUICKSEARCH), 'refresh_time' => intval($prefs->getValue('refresh_time')))), 'text' => array('exitsearch' => _("Exit Search"), 'folders' => _("Folders"), 'message_0' => _("No messages"), 'message_1' => _("1 message"), 'message_2' => _("%d messages"), 'more_msgs' => _("Load More Messages..."), 'move_nombox' => _("Must enter a non-empty name for the new destination mailbox."), 'new_message' => _("New Message"), 'nofrom' => _("Invalid Address"), 'nosubject' => _("The message does not have a Subject entered.") . "\n" . _("Send message without a Subject?"), 'searchresults' => _("Search Results"), 'subject' => _("Subject")));
     $page_output->addInlineJsVars(array('var IMP' => $code), array('top' => true));
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:10,代码来源:Smartmobile.php

示例13: _addMailboxVars

 /**
  */
 protected function _addMailboxVars()
 {
     global $injector, $prefs, $registry;
     /* Does server support ACLs? */
     $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
     $acl = $imp_imap->access(IMP_Imap::ACCESS_ACL);
     $subscribe = $prefs->getValue('subscribe');
     $this->js_conf += array_filter(array('URI_LISTINFO' => strval(IMP_Basic_Listinfo::url()->setRaw(true)), 'URI_MESSAGE' => strval(IMP_Dynamic_Message::url()->setRaw(true)), 'URI_PORTAL' => strval($registry->getServiceLink('portal')->setRaw(true)), 'URI_PREFS_IMP' => strval($registry->getServiceLink('prefs', 'imp')->setRaw(true)), 'URI_SEARCH' => strval(IMP_Basic_Search::url()->setRaw(true)), 'URI_THREAD' => strval(IMP_Basic_Thread::url()->setRaw(true)), 'FLAG_DELETED' => Horde_Imap_Client::FLAG_DELETED, 'FLAG_DRAFT' => Horde_Imap_Client::FLAG_DRAFT, 'FLAG_INNOCENT' => Horde_Imap_Client::FLAG_NOTJUNK, 'FLAG_SEEN' => Horde_Imap_Client::FLAG_SEEN, 'FLAG_SPAM' => Horde_Imap_Client::FLAG_JUNK, 'msglist_template_horiz' => file_get_contents(IMP_TEMPLATES . '/dynamic/msglist_horiz.html'), 'msglist_template_vert' => file_get_contents(IMP_TEMPLATES . '/dynamic/msglist_vert.html'), 'acl' => $acl, 'filter_any' => intval($prefs->getValue('filter_any_mailbox')), 'fsearchid' => IMP_Mailbox::formTo(IMP_Search::MBOX_PREFIX . IMP_Search::FILTERSEARCH), 'initial_page' => is_null($initial_page = IMP::getInitialPage()->mbox) ? null : $initial_page->form_to, 'mbox_expand' => intval($prefs->getValue('nav_expanded') == 2), 'name' => $registry->get('name', 'imp'), 'poll_alter' => intval(!$prefs->isLocked('nav_poll') && !$prefs->getValue('nav_poll_all')), 'qsearchid' => IMP_Mailbox::formTo(IMP_Search::MBOX_PREFIX . IMP_Search::QUICKSEARCH), 'refresh_time' => intval($prefs->getValue('refresh_time')), 'sidebar_width' => max(intval($prefs->getValue('sidebar_width')), 150), 'sort' => array('from' => array('c' => 'msgFrom', 't' => _("From"), 'v' => Horde_Imap_Client::SORT_FROM), 'to' => array('c' => 'msgFrom', 'ec' => 'msgFromTo', 't' => _("To"), 'v' => Horde_Imap_Client::SORT_TO), 'subject' => array('c' => 'msgSubject', 't' => _("Subject"), 'v' => Horde_Imap_Client::SORT_SUBJECT), 'thread' => array('c' => 'msgSubject', 'v' => Horde_Imap_Client::SORT_THREAD), 'date' => array('c' => 'msgDate', 't' => _("Date"), 'v' => IMP::IMAP_SORT_DATE), 'msgarrival' => array('c' => 'msgDate', 'v' => Horde_Imap_Client::SORT_ARRIVAL), 'msgdate' => array('c' => 'msgDate', 'v' => Horde_Imap_Client::SORT_DATE), 'sequence' => array('v' => Horde_Imap_Client::SORT_SEQUENCE), 'size' => array('c' => 'msgSize', 't' => _("Size"), 'v' => Horde_Imap_Client::SORT_SIZE)), 'subscribe' => intval($subscribe)));
     $context = array('ctx_container' => array('_mbox' => '', '_sep1' => null, 'create' => _("Create subfolder"), 'rename' => _("Rename"), 'delete' => _("Delete subfolders"), '_sep2' => null, 'search' => _("Search"), '_sep3' => null, 'expand' => _("Expand All"), 'collapse' => _("Collapse All")), 'ctx_datesort' => array('*msgarrival' => _("Arrival Time"), '*msgdate' => _("Message Date")), 'ctx_flag' => array(), 'ctx_flagunset' => array(), 'ctx_flag_search' => array(), 'ctx_mbox_flag' => array('seen' => _("Seen"), 'unseen' => _("Unseen")), 'ctx_noactions' => array('_mbox' => '', '_sep1' => null, 'noaction' => _("No actions available")), 'ctx_remoteauth' => array('_mbox' => '', '_sep1' => null, 'create' => _("Create Mailbox"), 'logout' => _("Log Out")), 'ctx_sortopts' => array('from' => _("From"), 'to' => _("To"), 'subject' => _("Subject"), 'thread' => _("Thread"), 'msgarrival' => _("Date (Arrival)"), 'msgdate' => _("Date (Message)"), 'size' => _("Size"), '_sep1' => null, 'sequence' => _("No Sort")), 'ctx_subjectsort' => array('thread' => _("Thread Sort")), 'ctx_template' => array('edit' => _("Edit Template"), 'new' => _("Create New Template")), 'ctx_vcontainer' => array('_mbox' => _("Virtual Folders"), '_sep1' => null, 'edit' => _("Edit Virtual Folders")), 'ctx_vfolder' => array('_mbox' => '', '_sep1' => null, 'edit' => _("Edit Virtual Folder"), 'delete' => _("Delete Virtual Folder")));
     /* Folder options context menu. */
     if ($imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
         $context['ctx_folderopts'] = array('new' => _("Create Mailbox"), 'sub' => _("Hide Unsubscribed"), 'unsub' => _("Show All Mailboxes"), 'expand' => _("Expand All"), 'collapse' => _("Collapse All"), '_sep1' => null, 'reload' => _("Rebuild Folder List"));
     }
     if (!$subscribe) {
         unset($context['ctx_folderopts']['sub'], $context['ctx_folderopts']['unsub']);
     }
     /* Message context menu. */
     $context['ctx_message'] = array('_sub1' => array('resume' => _("Resume Draft"), 'template' => _("Use Template"), 'template_edit' => _("Edit Template"), 'view' => _("View Message")), 'reply' => _("Reply"), 'forward' => _("Forward"), '_sub2' => array('_sep1' => null, 'setflag' => _("Mark as") . '...', 'unsetflag' => _("Unmark as") . '...'), '_sep2' => null, 'spam' => _("Report as Spam"), 'innocent' => _("Report as Innocent"), 'blacklist' => _("Blacklist"), 'whitelist' => _("Whitelist"), 'addfilter' => _("Create Filter"), 'delete' => _("Delete"), 'undelete' => _("Undelete"), '_sub3' => array('_sep3' => null, 'source' => _("View Source")));
     if (empty($imp_imap->config->spam_params)) {
         unset($context['ctx_message']['spam']);
     }
     if (empty($imp_imap->config->innocent_params)) {
         unset($context['ctx_message']['innocent']);
     }
     if (!$registry->hasLink('mail/newEmailFilter')) {
         unset($context['ctx_message']['addfilter']);
     }
     $view_source = $injector->getInstance('Horde_Core_Perms')->hasAppPermission('view_msg_source');
     if (!$view_source) {
         unset($context['ctx_message']['_sub3']);
     }
     /* Mailbox context menu. */
     $context['ctx_mbox'] = array('_mbox' => '', '_sep1' => null, 'create' => _("Create subfolder"), 'rename' => _("Rename"), 'empty' => _("Empty"), 'delete' => _("Delete"), '_sep2' => null, 'setflag' => _("Mark all as"), '_sep3' => null, 'poll' => _("Check for New Mail"), 'nopoll' => _("Do Not Check for New Mail"), 'sub' => _("Subscribe"), 'unsub' => _("Unsubscribe"), '_sep4' => null, 'search' => _("Search"), '_sub1' => array('_sep5' => null, 'expand' => _("Expand All"), 'collapse' => _("Collapse All")), '_sep6' => null, 'export' => _("Export"), 'import' => _("Import"), '_sep7' => null, 'size' => _("Mailbox Size"), '_sub2' => array('_sep8' => null, 'acl' => _("Edit ACL")));
     if (!$subscribe) {
         unset($context['ctx_mbox']['sub'], $context['ctx_mbox']['unsub']);
     }
     if (!$imp_imap->access(IMP_Imap::ACCESS_IMPORT)) {
         unset($context['ctx_mbox']['import']);
     }
     if (!$imp_imap->access(IMP_Imap::ACCESS_FLAGS)) {
         unset($context['ctx_mbox']['_sep2'], $context['ctx_mbox']['setflag'], $context['ctx_mbox']['_sep3'], $context['ctx_mbox']['poll'], $context['ctx_mbox']['nopoll']);
     }
     if (!$imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
         unset($context['ctx_mbox']['_sep7'], $context['ctx_mbox']['size']);
     }
     if (!$imp_imap->access(IMP_Imap::ACCESS_SEARCH)) {
         unset($context['ctx_mbox']['_sep4'], $context['ctx_mbox']['search']);
     }
     if (!$imp_imap->access(IMP_Imap::ACCESS_FLAGS) || $prefs->isLocked('acl')) {
         unset($context['ctx_mbox']['_sub2']);
     }
     /* Other Actions context menu. */
     $context['ctx_oa'] = array('preview_hide' => _("Hide Preview"), 'preview_show' => _("Show Preview"), 'layout_horiz' => _("Horizontal Layout"), 'layout_vert' => _("Vertical Layout"), '_sub1' => array('_sep1' => null, 'setflag' => _("Mark as") . '...', 'unsetflag' => _("Unmark as") . '...'), 'blacklist' => _("Blacklist"), 'whitelist' => _("Whitelist"), '_sub2' => array('_sep2' => null, 'purge_deleted' => _("Purge Deleted"), 'undelete' => _("Undelete")), 'show_deleted' => _("Show Deleted"), 'hide_deleted' => _("Hide Deleted"), '_sub3' => array('_sep3' => null, 'clear_sort' => _("Clear Sort")));
     if ($prefs->isLocked('delhide')) {
         unset($context['ctx_oa']['hide_deleted']);
     }
     /* Shared between message and other actions menus. */
     if (!$registry->hasMethod('mail/blacklistFrom')) {
         unset($context['ctx_message']['blacklist'], $context['ctx_oa']['blacklist']);
     }
     if (!$registry->hasMethod('mail/whitelistFrom')) {
         unset($context['ctx_message']['whitelist'], $context['ctx_oa']['whitelist']);
     }
     /* Preview context menu. */
     $context['ctx_preview'] = array('save' => _("Save"), 'viewsource' => _("View Source"), 'allparts' => _("All Parts"), 'thread' => _("View Thread"), 'listinfo' => _("List Info"));
     if (!$view_source) {
         unset($context['ctx_preview']['viewsource']);
     }
     /* Search related context menus. */
     if ($imp_imap->access(IMP_Imap::ACCESS_SEARCH)) {
         $context['ctx_filteropts'] = array('*filter' => _("Filter By"), '*flag' => _("Show Only"), '*flagnot' => _("Don't Show"));
         if (IMP_Filter::canApplyFilters()) {
             $context['ctx_filteropts']['_sub1'] = array('_sep1' => null, 'applyfilters' => _("Apply Filters"));
         }
         $context['ctx_qsearchopts'] = array('*all' => _("Entire Message"), '*body' => _("Body"), '*from' => _("From"), '*recip' => _("Recipients (To/Cc/Bcc)"), '*subject' => _("Subject"), '_sep1' => null, '*advanced' => _("Advanced Search..."));
         /* Generate filter array. */
         $iterator = IMP_Search_IteratorFilter::create(IMP_Search_IteratorFilter::FILTER);
         $context['ctx_filter'] = array();
         foreach ($iterator as $val) {
             if ($val->enabled) {
                 $context['ctx_filter']['*' . $val->id] = $val->label;
             }
         }
     }
     /* Remote accounts context menu. */
     if ($imp_imap->access(IMP_Imap::ACCESS_REMOTE)) {
         $context['ctx_rcontainer'] = array('*prefs' => _("Manage Remote Accounts"));
     }
     $this->js_context = array_merge($context, $this->js_context);
     $this->js_text += array('atc_downloadall' => _("Download All (%s)"), 'badaddr' => _("Invalid Address"), 'badsubject' => _("Invalid Subject"), 'baselevel' => _("base level of the folder tree"), 'check' => _("Checking..."), 'copyto' => _("Copy %s to %s"), 'create_prompt' => _("Create mailbox:"), 'createsub_prompt' => _("Create subfolder of %s:"), 'delete_mbox' => _("Permanently delete %s?"), '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."), 'empty_mbox' => _("Permanently delete all %d messages in %s?"), 'import_mbox' => _("Mbox or .eml file:"), 'import_mbox_loading' => _("Importing (this may take some time)..."), 'listmsg_wait' => _("The server is still generating the message list."), 'listmsg_timeout' => _("The server was unable to generate the message list."), 'loading' => _("Loading..."), 'message_0' => _("No messages"), 'message_1' => _("1 message"), 'message_2' => _("%d messages"), 'mboxsize' => _("%s is: %s."), 'moveto' => _("Move %s to %s"), 'newflag_name' => _("Flag Name:"), 'newflag_wait' => _("Creating New Flag..."), 'no_folder_name' => _("Must enter a folder name"), 'onlogout' => _("Logging Out..."), 'portal' => _("Portal"), 'prefs' => _("User Options"), 'remote_password' => _("Password for %s:"), 'rename_prompt' => _("Rename %s to:"), 'search' => _("Search"), 'search_input' => _("Search (%s)"), 'search_time' => _("Results are %d Minutes Old"), 'selected' => _("%s selected."), 'slidertext' => _("Messages %d - %d"), 'vfolder' => _("Virtual Folder: %s"), 'vp_empty' => _("There are no messages in this mailbox."), 'vp_empty_search' => _("No messages matched the search query."));
     if ($subscribe) {
         $this->js_text += array('subscribe_mbox' => _("Subscribe to %s?"), 'subscribe_mbox_subfolders' => _("Subscribe to all subfolders of %s?"), 'unsubscribe_mbox' => _("Unsubscribe to %s?"), 'unsubscribe_mbox_subfolders' => _("Unsubscribe to all subfolders of %s?"));
     }
 }
开发者ID:horde,项目名称:horde,代码行数:96,代码来源:Mailbox.php

示例14: toArray

 /**
  * Returns an array containing compressed UID values.
  *
  * @return array  Keys are base64 encoded mailbox names, values are
  *                sequence strings.
  */
 public function toArray()
 {
     $converted = array();
     $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create();
     foreach ($this->_indices as $key => $val) {
         $converted[IMP_Mailbox::formTo($key)] = strval($imp_imap->getIdsOb($val));
     }
     return $converted;
 }
开发者ID:horde,项目名称:horde,代码行数:15,代码来源:Indices.php

示例15: _init


//.........这里部分代码省略.........
         $args = array('imap' => true, 'mailbox' => $mailbox);
         $form_set = $form_unset = array();
         foreach ($imp_flags->getList($args) as $val) {
             if ($val->canset) {
                 $form_set[] = array('f' => $val->form_set, 'l' => $val->label);
                 $form_unset[] = array('f' => $val->form_unset, 'l' => $val->label);
             }
         }
         $n_view->flaglist_set = $form_set;
         $n_view->flaglist_unset = $form_unset;
     }
     if ($imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
         $n_view->move = Horde::widget(array('url' => '#', 'class' => 'moveAction', 'title' => _("Move"), 'nocheck' => true));
         $n_view->copy = Horde::widget(array('url' => '#', 'class' => 'copyAction', 'title' => _("Copy"), 'nocheck' => true));
         $iterator = new IMP_Ftree_IteratorFilter($injector->getInstance('IMP_Ftree'));
         $iterator->add($iterator::NONIMAP);
         $n_view->options = new IMP_Ftree_Select(array('heading' => _("This message to"), 'inc_tasklists' => true, 'inc_notepads' => true, 'iterator' => $iterator, 'new_mbox' => true));
     }
     $n_view->back_to = Horde::widget(array('url' => $mailbox_url, 'title' => sprintf(_("Bac_k to %s"), $h_page_label), 'nocheck' => true));
     if ($prev_url) {
         $n_view->prev = Horde::link($prev_url, _("Previous Message"));
         $n_view->prev_img = 'navleftImg';
     } else {
         $n_view->prev_img = 'navleftgreyImg';
     }
     if ($next_url) {
         $n_view->next = Horde::link($next_url, _("Next Message"));
         $n_view->next_img = 'navrightImg';
     } else {
         $n_view->next_img = 'navrightgreyImg';
     }
     /* Prepare the navbar actions template. */
     $a_view = clone $view;
     $compose_params = array('buid' => $buid, 'identity' => $identity, 'mailbox' => IMP_Mailbox::formTo($mailbox));
     if (!$prefs->getValue('compose_popup')) {
         $compose_params['start'] = $msgindex;
     }
     if ($msg_index['m']->access_deletemsgs) {
         if (in_array(Horde_Imap_Client::FLAG_DELETED, $flags)) {
             $a_view->delete = Horde::widget(array('url' => $self_link->copy()->add('actionID', 'undelete_message'), 'title' => _("Undelete"), 'nocheck' => true));
         } else {
             $a_view->delete = Horde::widget(array('url' => $self_link->copy()->add('actionID', 'delete_message'), 'title' => _("_Delete"), 'nocheck' => true));
             if (!$msg_index['m']->is_imap) {
                 $js_vars['ImpMessage.pop3delete'] = _("Are you sure you want to PERMANENTLY delete these messages?");
             }
         }
     }
     $disable_compose = !IMP_Compose::canCompose();
     if (!$disable_compose) {
         $clink_ob = new IMP_Compose_Link();
         $clink = $clink_ob->link()->add($compose_params);
         $a_view->reply = Horde::widget(array('url' => $clink->add(array('actionID' => 'reply_auto')), 'class' => 'horde-hasmenu', 'title' => _("_Reply"), 'nocheck' => true));
         $a_view->reply_sender = Horde::widget(array('url' => $clink->add(array('actionID' => 'reply')), 'title' => _("To Sender"), 'nocheck' => true));
         if ($list_info['reply_list']) {
             $a_view->reply_list = Horde::widget(array('url' => $clink->add(array('actionID' => 'reply_list')), 'title' => _("To _List"), 'nocheck' => true));
         }
         $addr_ob = clone $envelope->to;
         $addr_ob->add($envelope->cc);
         $addr_ob->setIteratorFilter(0, $imp_identity->getAllFromAddresses());
         if (count($addr_ob)) {
             $a_view->show_reply_all = Horde::widget(array('url' => $clink->add(array('actionID' => 'reply_all')), 'title' => _("To _All"), 'nocheck' => true));
         }
         $fwd_locked = $prefs->isLocked('forward_default');
         $a_view->forward = Horde::widget(array('url' => $clink->add(array('actionID' => 'forward_auto')), 'class' => $fwd_locked ? '' : ' horde-hasmenu', 'title' => _("Fo_rward"), 'nocheck' => true));
         if (!$fwd_locked) {
             $a_view->forward_attach = Horde::widget(array('url' => $clink->add(array('actionID' => 'forward_attach')), 'title' => _("As Attachment"), 'nocheck' => true));
开发者ID:jubinpatel,项目名称:horde,代码行数:67,代码来源:Message.php


注:本文中的IMP_Mailbox::formTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。