r52193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52192‎ | r52193 | r52194 >
Date:09:21, 20 June 2009
Author:siebrand
Status:ok
Tags:
Comment:
Suppress display of duplicate getCategoryBottom() if there are no category members to display.

Cannot know if completely suppressing this is possible (and show 'category-empty'), because 'until' or 'from' can be set and previous/next *may* give results). Adding a FIXME for that.
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -95,12 +95,23 @@
9696 $this->doCategoryQuery();
9797 $this->finaliseCategoryState();
9898
99 - $r = $this->getCategoryTop() .
100 - $this->getSubcategorySection() .
 99+ $r = $this->getSubcategorySection() .
101100 $this->getPagesSection() .
102 - $this->getImageSection() .
103 - $this->getCategoryBottom();
 101+ $this->getImageSection();
104102
 103+ if( $r == '' ) {
 104+ // If there is no category content to display, only
 105+ // show the top part of the navigation links.
 106+ // FIXME: cannot be completely suppressed because it
 107+ // is unknown if 'until' or 'from' makes this
 108+ // give 0 results.
 109+ $r = $r . $this->getCategoryTop();
 110+ } else {
 111+ $r = $this->getCategoryTop() .
 112+ $r .
 113+ $this->getCategoryBottom();
 114+ }
 115+
105116 // Give a proper message if category is empty
106117 if ( $r == '' ) {
107118 $r = wfMsgExt( 'category-empty', array( 'parse' ) );

Status & tagging log