Last modified: 2010-05-15 14:36:04 UTC
--- CategoryTreeFunctions.php.old 2006-11-22 19:45:26.000000000 +0100 +++ CategoryTreeFunctions.php 2006-11-22 19:48:44.000000000 +0100 @@ -269,6 +269,7 @@ * $title must be a Title object */ function renderNode( &$title, $mode = CT_MODE_CATEGORIES, $children = false, $loadchildren = false ) { + global $wgCategoryOmitPrefix; static $uniq = 0; $load = false; @@ -286,8 +287,9 @@ #$trans = $title->getLocalizedText(); $trans = ''; #place holder for when translated titles are available - #when showing only categories, omit namespace in label - if ( $mode == CT_MODE_CATEGORIES ) $label = htmlspecialchars( $title->getText() ); + #when showing only categories, omit namespace in label unless we explicitely defined the configuration setting + #patch contributed by Manuel Schneider <manuel.schneider@wikimedia.ch> + if ( $wgCategoryOmitPrefix || $mode == CT_MODE_CATEGORIES ) $label = htmlspecialchars( $title->getText() ); else $label = htmlspecialchars( $title->getPrefixedText() ); if ( $trans && $trans!=$label ) $label.= ' ' . wfElement( 'i', array( 'class' => 'translation'), $trans );
--- CategoryTreeFunctions.php.old 2006-11-22 19:45:26.000000000 +0100 +++ CategoryTreeFunctions.php 2006-11-22 20:04:05.000000000 +0100 @@ -269,6 +269,7 @@ * $title must be a Title object */ function renderNode( &$title, $mode = CT_MODE_CATEGORIES, $children = false, $loadchildren = false ) { + global $wgCategoryTreeOmitPrefix; static $uniq = 0; $load = false; @@ -286,8 +287,9 @@ #$trans = $title->getLocalizedText(); $trans = ''; #place holder for when translated titles are available - #when showing only categories, omit namespace in label - if ( $mode == CT_MODE_CATEGORIES ) $label = htmlspecialchars( $title->getText() ); + #when showing only categories, omit namespace in label unless we explicitely defined the configuration setting + #patch contributed by Manuel Schneider <manuel.schneider@wikimedia.ch> + if ( $wgCategoryTreeOmitPrefix || $mode == CT_MODE_CATEGORIES ) $label = htmlspecialchars( $title->getText() ); else $label = htmlspecialchars( $title->getPrefixedText() ); if ( $trans && $trans!=$label ) $label.= ' ' . wfElement( 'i', array( 'class' => 'translation'), $trans );
--- README.old 2006-11-22 20:01:20.000000000 +0100 +++ README 2006-11-22 20:02:57.000000000 +0100 @@ -87,5 +87,7 @@ $wgCategoryTreeHTTPCache - enable HTTP cache for anon users. Default is false. +$wgCategoryTreeOmitPrefix - Omit namespace prefix of categories even if in + "page" or "all" mode. --------------------------------------------------------------------------
Please submit patches as attachments to the bug, and ensure that it is marked as a patch.
Created attachment 2758 [details] adds new configuration variable and changes the output of the category tree
Created attachment 2759 [details] describe new configuration variable in documentation
fixed in r17863. The Option is called $wgCategoryTreeOmitNamespace though.