Re: RFC Nested Set manipulation class
| From: | Daniel Khan | Date: | Tue, 18 Mar 2003 20:17:46 +0000 |
| Subject: | Re: RFC Nested Set manipulation class | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14410@lists.php.net to get a copy of this message | ||
Richard Wall wrote:
[..]
> > The package helps with manipulating nested sets.
> > It also allows to move and copy trees and subtrees and it
> > implements a callback mechanism to
> > call other methods on node move, delete, etc..
>
> Sounds interesting, but have you got any examples of how to use it. I
> guess it's for handling table records in a single table eg a table of
> employees with parent manager links.
I'll set up a little site with examples.
Basically the class allows you to store and manipulate trees inside a
relational database.
It can be used for directory structures inside a CMS but also to store
items for a webshop or threads for a forum, etc.
In our case we use the class in a general purpose framework which
allows us to create GUI's for backends and CMS.
We have a table with node types. Each created node has a type.
Depending on the type, we call different modules of the framework.
So we can have a node which gives us a shop item editor and another
node which contains the permission settings.
The menu is created using a open source javascript called treemenu.
Here a screenshot how the menu looks like:
http://vie1.webcluster.at/relatix.jpg
It's german but that shouldn't be a problem in this case.
I can contribute the methods for creating the array for treemenu too but
I don't know if that really fits into pear (?)
> Re the callback facility. Wouldn't it be better to define an
> 'addEventListener($eventType, &$eventListener)' and
> dispatch/triggerEvent($eventType) methods and an eventListener
> interface from which eventListeners could inherit. Might make things
> simpler.
That's a very good point.
I'll add that if the package is accepted to pear. I am now also thinking
that the callback thing isn't that smart but in my case it does it's job
:)
--
Daniel [datenPUNK] Khan