From 74d4302939ec2a873c9fc8d6125f039df686c270 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 20 Jun 2009 09:21:33 +0000 Subject: [PATCH] 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. --- includes/CategoryPage.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index f431045e7a..3f3f67c560 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -95,11 +95,22 @@ class CategoryViewer { $this->doCategoryQuery(); $this->finaliseCategoryState(); - $r = $this->getCategoryTop() . - $this->getSubcategorySection() . + $r = $this->getSubcategorySection() . $this->getPagesSection() . - $this->getImageSection() . - $this->getCategoryBottom(); + $this->getImageSection(); + + if( $r == '' ) { + // If there is no category content to display, only + // show the top part of the navigation links. + // FIXME: cannot be completely suppressed because it + // is unknown if 'until' or 'from' makes this + // give 0 results. + $r = $r . $this->getCategoryTop(); + } else { + $r = $this->getCategoryTop() . + $r . + $this->getCategoryBottom(); + } // Give a proper message if category is empty if ( $r == '' ) { -- 2.20.1