Index: trunk/phase3/includes/Skin.php |
— | — | @@ -430,34 +430,33 @@ |
431 | 431 | # get a big array of the parents tree |
432 | 432 | $parenttree = $wgTitle->getParentCategoryTree(); |
433 | 433 | |
434 | | - # Render the array as a serie of links |
435 | | - # Need to give skin cause $this is undefined at this level |
436 | | - function walkThrough ($tree, &$skin) { |
437 | | - $return = ''; |
438 | | - foreach($tree as $element => $parent) { |
439 | | - if(empty($parent)) { |
440 | | - # element start a new list |
441 | | - $return .= '<br />'; |
442 | | - } else { |
443 | | - # grab the others elements |
444 | | - $return .= walkThrough($parent, $skin); |
445 | | - } |
446 | | - # add our current element to the list |
447 | | - $eltitle = Title::NewFromText($element); |
448 | | - if(!empty($parent)) $return .= ' > '; |
449 | | - $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ; |
450 | | - } |
451 | | - return $return; |
452 | | - } |
453 | | - |
454 | 434 | # Skin object passed by reference cause it can not be |
455 | 435 | # accessed under the method subfunction walkThrough. |
456 | | - $s .= walkThrough($parenttree, $this); |
| 436 | + $s .= Skin::drawCategoryBrowser($parenttree, $this); |
457 | 437 | } |
458 | 438 | |
459 | 439 | return $s; |
460 | 440 | } |
461 | 441 | |
| 442 | + # Render the array as a serie of links |
| 443 | + function drawCategoryBrowser ($tree, &$skin) { |
| 444 | + $return = ''; |
| 445 | + foreach ($tree as $element => $parent) { |
| 446 | + if (empty($parent)) { |
| 447 | + # element start a new list |
| 448 | + $return .= '<br />'; |
| 449 | + } else { |
| 450 | + # grab the others elements |
| 451 | + $return .= Skin::drawCategoryBrowser($parent, $skin); |
| 452 | + } |
| 453 | + # add our current element to the list |
| 454 | + $eltitle = Title::NewFromText($element); |
| 455 | + if (!empty($parent)) $return .= ' > '; |
| 456 | + $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ; |
| 457 | + } |
| 458 | + return $return; |
| 459 | + } |
| 460 | + |
462 | 461 | function getCategories() { |
463 | 462 | $catlinks=$this->getCategoryLinks(); |
464 | 463 | if(!empty($catlinks)) { |