Index: trunk/extensions/CategoryTree/CategoryTree.php |
— | — | @@ -34,6 +34,7 @@ |
35 | 35 | * $wgCategoryTreeDisableCache - disabled the parser cache for pages with a <categorytree> tag. Default is true. |
36 | 36 | * $wgCategoryTreeUseCache - enable HTTP cache for anon users. Default is false. |
37 | 37 | * $wgCategoryTreeUnifiedView - use unified view on category pages, instead of "tree" or "traditional list". Default is true. |
| 38 | + * $wgCategoryTreeOmitNamespace - never show namespace prefix. Default is false |
38 | 39 | */ |
39 | 40 | $wgCategoryTreeMaxChildren = 200; |
40 | 41 | $wgCategoryTreeAllowTag = true; |
— | — | @@ -41,6 +42,7 @@ |
42 | 43 | $wgCategoryTreeDynamicTag = false; |
43 | 44 | $wgCategoryTreeHTTPCache = false; |
44 | 45 | $wgCategoryTreeUnifiedView = true; |
| 46 | +$wgCategoryTreeOmitNamespace = false; |
45 | 47 | |
46 | 48 | /** |
47 | 49 | * Register extension setup hook and credits |
Index: trunk/extensions/CategoryTree/README |
— | — | @@ -87,5 +87,9 @@ |
88 | 88 | $wgCategoryTreeHTTPCache - enable HTTP cache for anon users. Default is |
89 | 89 | false. |
90 | 90 | |
| 91 | +$wgCategoryTreeOmitNamespace - never show namespace prefix. Default is |
| 92 | + false. Patch contributed by Manuel Schneider |
| 93 | + <manuel.schneider@wikimedia.ch>, Bug 8011 |
| 94 | + |
91 | 95 | -------------------------------------------------------------------------- |
92 | 96 | EOF |
\ No newline at end of file |
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php |
— | — | @@ -269,6 +269,7 @@ |
270 | 270 | * $title must be a Title object |
271 | 271 | */ |
272 | 272 | function renderNode( &$title, $mode = CT_MODE_CATEGORIES, $children = false, $loadchildren = false ) { |
| 273 | + global $wgCategoryTreeOmitNamespace; |
273 | 274 | static $uniq = 0; |
274 | 275 | |
275 | 276 | $load = false; |
— | — | @@ -286,8 +287,9 @@ |
287 | 288 | #$trans = $title->getLocalizedText(); |
288 | 289 | $trans = ''; #place holder for when translated titles are available |
289 | 290 | |
290 | | - #when showing only categories, omit namespace in label |
291 | | - if ( $mode == CT_MODE_CATEGORIES ) $label = htmlspecialchars( $title->getText() ); |
| 291 | + #when showing only categories, omit namespace in label unless we explicitely defined the configuration setting |
| 292 | + #patch contributed by Manuel Schneider <manuel.schneider@wikimedia.ch>, Bug 8011 |
| 293 | + if ( $wgCategoryTreeOmitNamespace || $mode == CT_MODE_CATEGORIES ) $label = htmlspecialchars( $title->getText() ); |
292 | 294 | else $label = htmlspecialchars( $title->getPrefixedText() ); |
293 | 295 | |
294 | 296 | if ( $trans && $trans!=$label ) $label.= ' ' . wfElement( 'i', array( 'class' => 'translation'), $trans ); |