[dev] Re: [cvs] commit: horde/lib Tree.php

Chuck Hagenbuch chuck at horde.org
Sun Feb 23 20:49:57 PST 2003


Quoting Marko Djukic <marko at oblo.com>:

> well with the tree class i committed i went with a simple array
> structure:
> array( node_id => array( 'label' => somelabel,
>                          'indent' => 3,
>                          'parent' => somenode_id,
>                          whatever other elements...
>                          .....))
> 
> maybe it has shortcomings that i have not foreseen, but it makes for easy
> navigation, and is much simpler to handle than the x => ..., y => ...
> type array in CATEGORY_FORMAT_3D... for example for the giapeto admin i 
> have to pull out the site tree, trim off the pages that the user doesn't 
> have permissions to, and tack onto pages more nodes to represent 
> permissions, users etc.

Basically:

- CATEGORY_FORMAT_3D can be exported directly out of a categories backend
- CategoryTree understands it and can work with it efficiently

I'm not tied to the format, but I *do* want a consistent API here. It makes
no sense to have both CategoryTree and Tree. I'd prefer that the new Tree
class extend CategoryTree - CategoryTree_dom, say - and it should either use
CATEGORY_FORMAT_3D, or you should add a new categories export format that it
can work with.

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
must ... find ... acorns ... *thud*


More information about the dev mailing list