diff options
author | River Tarnell <kateturner@users.mediawiki.org> | 2005-07-02 22:39:22 +0000 |
---|---|---|
committer | River Tarnell <kateturner@users.mediawiki.org> | 2005-07-02 22:39:22 +0000 |
commit | ca83d978086cdc4f3c2b58ee5b4feb7c8d439c34 (patch) | |
tree | c35658ccf1394c2b6ce9ae9190368ed88bf55082 /includes | |
parent | 37f7039ee633e01a6e59eb4b818cd9a48eca33a0 (diff) | |
download | mediawikicore-ca83d978086cdc4f3c2b58ee5b4feb7c8d439c34.tar.gz mediawikicore-ca83d978086cdc4f3c2b58ee5b4feb7c8d439c34.zip |
avoid breaking on php5
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/9840
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Skin.php | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/includes/Skin.php b/includes/Skin.php index 140e6ade8721..65b16d31dcdc 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -430,34 +430,33 @@ END; # get a big array of the parents tree $parenttree = $wgTitle->getParentCategoryTree(); - # Render the array as a serie of links - # Need to give skin cause $this is undefined at this level - function walkThrough ($tree, &$skin) { - $return = ''; - foreach($tree as $element => $parent) { - if(empty($parent)) { - # element start a new list - $return .= '<br />'; - } else { - # grab the others elements - $return .= walkThrough($parent, $skin); - } - # add our current element to the list - $eltitle = Title::NewFromText($element); - if(!empty($parent)) $return .= ' > '; - $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ; - } - return $return; - } - # Skin object passed by reference cause it can not be # accessed under the method subfunction walkThrough. - $s .= walkThrough($parenttree, $this); + $s .= Skin::drawCategoryBrowser($parenttree, $this); } return $s; } + # Render the array as a serie of links + function drawCategoryBrowser ($tree, &$skin) { + $return = ''; + foreach ($tree as $element => $parent) { + if (empty($parent)) { + # element start a new list + $return .= '<br />'; + } else { + # grab the others elements + $return .= Skin::drawCategoryBrowser($parent, $skin); + } + # add our current element to the list + $eltitle = Title::NewFromText($element); + if (!empty($parent)) $return .= ' > '; + $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ; + } + return $return; + } + function getCategories() { $catlinks=$this->getCategoryLinks(); if(!empty($catlinks)) { |