function getCategoryLinks () {
global $wgOut, $wgTitle, $wgUser, $wgParser;
- global $wgUseCategoryMagic;
+ global $wgUseCategoryMagic, $wgLang;
if( !$wgUseCategoryMagic ) return "" ;
if( count( $wgOut->mCategoryLinks ) == 0 ) return "";
if( !$wgOut->isArticle() ) return "";
$wgTitle->getAllParentCategories(&$catstack);
foreach ($catstack as $key => $cat)
{
- $s .= $key." > ".$cat."<br/>\n";
+ $s .= $this->makeLink($wgLang->getNSText( Namespace::getCategory() ).":".$key, $key )." > ".$cat."<br/>\n";
}
return $s;
# will get the parents and grand-parents
function getAllParentCategories(&$stack)
{
+ global $wgUser;
+ $sk =& $wgUser->getSkin() ;
+
# getting parents
$parents = $this->getParentCategories( );
# create a title object for the parent
$tpar = Title::newFromID($parent->cur_id);
- $stack[$tpar->getText()] = $this->getText();
if(isset($stack[$this->getText()]))
{
+ $stack[$tpar->getText()] = $sk->makeLink( $this->getPrefixedDBkey(), $this->getText() );
$stack[$tpar->getText()] .= " > ".$stack[$this->getText()];
+ } else {
+ # don't make a link for current page
+ $stack[$tpar->getText()] = $this->getText();
}
unset( $stack[$this->getText()] );