From: Michael M Slusarz Date: Tue, 17 Aug 2010 18:11:29 +0000 (-0600) Subject: Git rid of IMP_Imap_Tree::FLIST_ELT mask option X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fa5e1d80599a6215f93c2ee567621cde5ae5845b;p=horde.git Git rid of IMP_Imap_Tree::FLIST_ELT mask option --- diff --git a/imp/folders-mimp.php b/imp/folders-mimp.php index 7a94e7532..0047624f4 100644 --- a/imp/folders-mimp.php +++ b/imp/folders-mimp.php @@ -33,7 +33,7 @@ $showAll = (!$subscribe || $_SESSION['imp']['showunsub']); /* 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')) { diff --git a/imp/folders.php b/imp/folders.php index 11667046b..fd75a9a9e 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -359,7 +359,6 @@ if ($_SESSION['imp']['file_upload'] && ($actionID == 'import_mbox')) { /* 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); diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index 89a7691cd..95502a3e0 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -285,7 +285,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $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; } diff --git a/imp/lib/Block/tree_folders.php b/imp/lib/Block/tree_folders.php index cdc8ebe29..6b896aafc 100644 --- a/imp/lib/Block/tree_folders.php +++ b/imp/lib/Block/tree_folders.php @@ -68,8 +68,7 @@ class Horde_Block_imp_tree_folders extends Horde_Block /* 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; diff --git a/imp/lib/Folder.php b/imp/lib/Folder.php index dc46270ca..786b6e68e 100644 --- a/imp/lib/Folder.php +++ b/imp/lib/Folder.php @@ -102,8 +102,7 @@ class IMP_Folder } $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; } @@ -326,7 +325,7 @@ class IMP_Folder $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); diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index d66e2077d..b3d983c59 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -51,11 +51,10 @@ class IMP_Imap_Tree 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. */ @@ -1573,19 +1572,16 @@ class IMP_Imap_Tree * 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. * - * * @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) { @@ -1647,9 +1643,7 @@ class IMP_Imap_Tree !$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))); } @@ -1663,7 +1657,6 @@ class IMP_Imap_Tree : $ret_array; } - /** * Return the list of 'special' mailboxes. * diff --git a/imp/search.php b/imp/search.php index 808e90a39..fa1c4c6cc 100644 --- a/imp/search.php +++ b/imp/search.php @@ -91,7 +91,7 @@ if (!empty($criteria)) { /* 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')) {