Page MenuHomePhabricator

Provide a configuration variable to omit namespace prefixes
Closed, ResolvedPublic

Description

  • 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 );


Version: unspecified
Severity: enhancement

Details

Reference
bz8011

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:29 PM
bzimport set Reference to bz8011.
bzimport added a subscriber: Unknown Object (MLST).
  • 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.


robchur wrote:

Please submit patches as attachments to the bug, and ensure that it is marked as
a patch.

Created attachment 2758
adds new configuration variable and changes the output of the category tree

Attached:

Created attachment 2759
describe new configuration variable in documentation

Attached:

fixed in r17863. The Option is called $wgCategoryTreeOmitNamespace though.