[imp] re-ordering the folder tree

Tobias Drewry tdrewry at bu.edu
Mon Jun 8 19:50:40 UTC 2009


Quoting Michael M Slusarz <slusarz at horde.org>:

> 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

Ah, I was hoping that I had missed something obvious that would allow 
me to reorder without introducing a new function call.

Thanks though, I'll send in what ever I come up with for anyone else 
who might want this some day.

Regards,
Tobias Drewry <tdrewry at bu.edu>
Analyst/Consultant III
Central Consulting Group
Boston University
617-353-8282




More information about the imp mailing list