Last modified: 2010-05-15 14:36:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8011 - Provide a configuration variable to omit namespace prefixes
Provide a configuration variable to omit namespace prefixes
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CategoryTree (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 8019
  Show dependency treegraph
 
Reported: 2006-11-22 18:53 UTC by Manuel Schneider
Modified: 2010-05-15 14:36 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
adds new configuration variable and changes the output of the category tree (1.11 KB, patch)
2006-11-22 19:14 UTC, Manuel Schneider
Details
describe new configuration variable in documentation (468 bytes, patch)
2006-11-22 19:14 UTC, Manuel Schneider
Details

Description Manuel Schneider 2006-11-22 18:53:33 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 );
Comment 1 Manuel Schneider 2006-11-22 19:05:35 UTC
--- 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 );
Comment 2 Manuel Schneider 2006-11-22 19:05:51 UTC
--- 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.
 --------------------------------------------------------------------------
Comment 3 Rob Church 2006-11-22 19:08:11 UTC
Please submit patches as attachments to the bug, and ensure that it is marked as
a patch.
Comment 4 Manuel Schneider 2006-11-22 19:14:28 UTC
Created attachment 2758 [details]
adds new configuration variable and changes the output of the category tree
Comment 5 Manuel Schneider 2006-11-22 19:14:57 UTC
Created attachment 2759 [details]
describe new configuration variable in documentation
Comment 6 Daniel Kinzler 2006-11-22 21:50:09 UTC
fixed in r17863. The Option is called $wgCategoryTreeOmitNamespace though.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links