/* Initialize the IMP_Imap_Tree object. */
$imptree = $injector->getInstance('IMP_Imap_Tree');
-$mask = IMP_Imap_Tree::FLIST_ELT;
+$mask = 0;
/* Toggle subscribed view, if necessary. */
if ($subscribe && Horde_Util::getFormData('ts')) {
/* Build the folder tree. */
$mask = IMP_Imap_Tree::FLIST_CONTAINER |
IMP_Imap_Tree::FLIST_VFOLDER |
- IMP_Imap_Tree::FLIST_ELT |
IMP_Imap_Tree::FLIST_EXPANDED;
$raw_rows = $imaptree->folderList($mask);
$initreload = ($this->_vars->initial || $this->_vars->reload);
$result = new stdClass;
- $mask = IMP_Imap_Tree::FLIST_CONTAINER | IMP_Imap_Tree::FLIST_VFOLDER | IMP_Imap_Tree::FLIST_ELT;
+ $mask = IMP_Imap_Tree::FLIST_CONTAINER | IMP_Imap_Tree::FLIST_VFOLDER;
if ($this->_vars->unsub) {
$mask |= IMP_Imap_Tree::FLIST_UNSUB;
}
/* Initialize the IMP_Tree object. */
$imaptree = $injector->getInstance('IMP_Imap_Tree');
$mask = IMP_Imap_Tree::FLIST_CONTAINER |
- IMP_Imap_Tree::FLIST_VFOLDER |
- IMP_Imap_Tree::FLIST_ELT;
+ IMP_Imap_Tree::FLIST_VFOLDER;
$unseen = 0;
$inbox = null;
}
$imaptree = $GLOBALS['injector']->getInstance('IMP_Imap_Tree');
-
- $list_mask = IMP_Imap_Tree::FLIST_CONTAINER | IMP_Imap_Tree::FLIST_ELT;
+ $list_mask = IMP_Imap_Tree::FLIST_CONTAINER;
if (!$sub) {
$list_mask |= IMP_Imap_Tree::FLIST_UNSUB;
}
$imaptree = $GLOBALS['injector']->getInstance('IMP_Imap_Tree');
/* Get list of any folders that are underneath this one. */
- $all_folders = array_merge(array($old), $imaptree->folderList(IMP_Imap_Tree::FLIST_UNSUB, $old));
+ $all_folders = array_merge(array($old), array_keys($imaptree->folderList(IMP_Imap_Tree::FLIST_UNSUB, $old)));
try {
$GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->renameMailbox($old, $new);
const FLIST_CONTAINER = 1;
const FLIST_UNSUB = 2;
const FLIST_VFOLDER = 4;
- const FLIST_ELT = 8;
- const FLIST_NOCHILDREN = 16;
- const FLIST_ANCESTORS = 32;
- const FLIST_SAMELEVEL = 64;
- const FLIST_EXPANDED = 128;
+ const FLIST_NOCHILDREN = 8;
+ const FLIST_ANCESTORS = 16;
+ const FLIST_SAMELEVEL = 32;
+ const FLIST_EXPANDED = 64;
/* Add null to folder key since it allows us to sort by name but
* never conflict with an IMAP mailbox. */
* IMP_Imap_Tree::FLIST_CONTAINER - Show container elements.
* IMP_Imap_Tree::FLIST_UNSUB - Show unsubscribed elements.
* IMP_Imap_Tree::FLIST_VFOLDER - Show Virtual Folders.
- * IMP_Imap_Tree::FLIST_ELT - Return IMP_Imap_Tree_Element object.
* IMP_Imap_Tree::FLIST_NOCHILDREN - Don't show child elements.
* IMP_Imap_Tree::FLIST_ANCESTORS - Include ancestors.
* IMP_Imap_Tree::FLIST_SAMELEVEL - Also return mailboxes at the same
* level as $base.
* IMP_Imap_Tree::FLIST_EXPANDED - Only included expanded folders.
* </pre>
- * </pre>
* @param string $base Return all mailboxes below this element.
*
- * @return array Either an array of IMAP mailbox names or an array of
- * IMP_Imap_Tree_Elt elements (if FLIST_ELT is specified).
- * Keys are the mailbox name.
+ * @return array Keys are mailbox name, values are IMP_Imap_Tree_Element
+ * objects.
*/
public function folderList($mask = 0, $base = null)
{
!$this->isContainer($mailbox)) &&
(($mask & self::FLIST_VFOLDER) ||
!$this->isVFolder($mailbox))) {
- $ret_array[$mailbox['v']] = ($mask & self::FLIST_ELT)
- ? $this->element($mailbox)
- : $mailbox['v'];
+ $ret_array[$mailbox['v']] = $this->element($mailbox);
}
} while (($mailbox = $this->next($nextmask)));
}
: $ret_array;
}
-
/**
* Return the list of 'special' mailboxes.
*
/* Generate master folder list. */
$imp_imap_tree = $injector->getInstance('IMP_Imap_Tree');
-$mask = IMP_Imap_Tree::FLIST_CONTAINER | IMP_Imap_Tree::FLIST_ELT;
+$mask = IMP_Imap_Tree::FLIST_CONTAINER;
$subscribe = $prefs->getValue('subscribe');
if (!$subscribe || Horde_Util::getFormData('show_unsub')) {