mgd_walk_event_tree
mgd_walk_event_tree -- walk an event tree
Description
`bool **mgd_walk_event_tree** (string func, int root, int maxlevel, mixed &xparam, bool order, string sort)`
Minimum version: Midgard 1.4 (Bifrost); the optional parameter sort was added in Midgard 1.4.1 (Bifrost)
Walks the event tree starting at the event record with id root to a level of _ maxlevel_ levels of depth. For each event the user defined call-back function func is called.
The call-back function func must conform to the following signature:
`void **callback** (int id, int level, mixed &xparam)`
The parameters explained: id is the id of the event currently being walked, level the level of descendance from the root level and &xparam a variable passed through by the user.
If the parameter order is FALSE or not defined, each event will be processed after all its children, otherwise it will be processed before them. If given, the optional sort parameter contains an SQL-like SORT statement such as "score DESC".
Returns TRUE on success, FALSE on failure.
