[imp] re-ordering the folder tree

Michael M Slusarz slusarz at horde.org
Mon Jun 8 18:11:57 UTC 2009


Quoting Tobias Drewry <tdrewry at bu.edu>:

> Quoting Michael M Slusarz <slusarz at horde.org>:
>
>> Quoting Tobias Drewry <tdrewry at bu.edu>:
>>
>>> Is it possible to re-order the folder tree which is generated for  
>>> the sidebar?
>>
>> imp/lib/Block/tree_folders.php
>
> thanks Mike, yes, I was playing in there as well.  However, that  
> file is by far one of the least documented of the files in Imp.
>
> Any pointers on where to start?  I'm thinking it'd need to go into  
> the foreach(tree_ob[0] as $val) loop, following the INBOX  
> declaration and probably before(?) the tree->addNode bit.  However,  
> I'm unclear as to how this would work.
>
> Sorry if I'm missing the obvious.

The order that the nodes are added to $tree (via addNode), the order  
they will appear in the folder list.  So if you want to change the  
order, you will need to add items in a different order.  Since  
$imaptree->build() only returns folders in one sort order, you will  
probably need to write your own function to sort the folder names.   
(The list of folders is contained in the IMP_Tree object.)

michael


-- 
___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the imp mailing list