Changeset 4779
- Timestamp:
- 01/22/2007 07:05:48 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r4753 r4779 429 429 // Previous element is my parent. Descend a level. 430 430 array_unshift($parents, $previous_element); 431 if ( !$to_depth || ($depth < $to_depth) ) { //only descend if we're below $to_depth 432 $cb_args = array_merge( array($output, $depth), $args); 433 $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args); 434 } else if ( $to_depth && $depth == $to_depth ) { // If we've reached depth, end the previous element. 435 $cb_args = array_merge( array($output, $previous_element, $depth), $args); 436 $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); 437 } 431 438 $depth++; //always do this so when we start the element further down, we know where we are 432 if ( !$to_depth || ($depth < $to_depth) ) { //only descend if we're below $to_depth433 $cb_args = array_merge( array($output, $depth - 1), $args);434 $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args);435 } else { // If we've reached depth, end the previous element.436 $cb_args = array_merge( array($output, $previous_element, $depth - 1), $args);437 $output = call_user_func_array(array(&$this, 'end_el'), $cb_args);438 }439 439 } else if ( $element->$parent_field == $previous_element->$parent_field) { 440 440 // On the same level as previous element. … … 453 453 $depth--; 454 454 if ( !$to_depth || ($depth < $to_depth) ) { 455 $cb_args = array_merge( array($output, $depth - 1), $args);455 $cb_args = array_merge( array($output, $depth), $args); 456 456 $output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args); 457 457 $cb_args = array_merge( array($output, $parent, $depth - 1), $args); … … 491 491 function start_lvl($output, $depth) { 492 492 $indent = str_repeat("\t", $depth); 493 $output .= " $indent<ul>\n";493 $output .= "\n$indent<ul>\n"; 494 494 return $output; 495 495 }
Note: See TracChangeset
for help on using the changeset viewer.