Open Source Content Management System

mgd_walk_style_tree

  1. Description

mgd_walk_style_tree -- Walk a style tree

Description

`bool **mgd_walk_style_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 style tree starting at the style record with id root to a level of _ maxlevel_ levels of depth. For each style 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 style 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 style 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.

Designed by Nemein, hosted by Anykey