*
* @param string $output Passed by reference. Used to append additional content.
*/
- function start_lvl(&$output) {}
+ function start_lvl( &$output, $depth = 0, $args = array() ) {}
/**
* Ends the list of after the elements are added.
*
* @param string $output Passed by reference. Used to append additional content.
*/
- function end_lvl(&$output) {}
+ function end_lvl( &$output, $depth = 0, $args = array() ) {}
/**
* Start the element output.
*
* @param string $output Passed by reference. Used to append additional content.
*/
- function start_el(&$output) {}
+ function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}
/**
* Ends the element output, if needed.
*
* @param string $output Passed by reference. Used to append additional content.
*/
- function end_el(&$output) {}
+ function end_el( &$output, $object, $depth = 0, $args = array() ) {}
/**
* Traverse elements to create list from elements.
* @param string $output Passed by reference. Used to append additional content.
* @return null Null on failure with no changes to parameters.
*/
- function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
+ function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( !$element )
return;
$id_field = $this->db_fields['id'];
//display this element
- if ( is_array( $args[0] ) )
+ if ( isset( $args[0] ) && is_array( $args[0] ) )
$args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
$cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'start_el'), $cb_args);
+ call_user_func_array(array($this, 'start_el'), $cb_args);
$id = $element->$id_field;
$newlevel = true;
//start the child delimiter
$cb_args = array_merge( array(&$output, $depth), $args);
- call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
+ call_user_func_array(array($this, 'start_lvl'), $cb_args);
}
$this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
}
if ( isset($newlevel) && $newlevel ){
//end the child delimiter
$cb_args = array_merge( array(&$output, $depth), $args);
- call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
+ call_user_func_array(array($this, 'end_lvl'), $cb_args);
}
//end this element
$cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'end_el'), $cb_args);
+ call_user_func_array(array($this, 'end_el'), $cb_args);
}
/**
}
}
-
-?>
\ No newline at end of file