Fix bug 20688 (Hidden categories still hidden if there are no non-hidden categories...
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 17 Sep 2009 15:24:04 +0000 (15:24 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 17 Sep 2009 15:24:04 +0000 (15:24 +0000)
includes/Skin.php

index 74d9fa0..42262cd 100644 (file)
@@ -895,11 +895,17 @@ END;
        }
 
        function getCategories() {
-               $catlinks=$this->getCategoryLinks();
+               $catlinks = $this->getCategoryLinks();
 
                $classes = 'catlinks';
+               
+               // Check what we're showing
+               global $wgOut, $wgUser;
+               $allCats = $wgOut->getCategoryLinks();
+               $showHidden = $wgUser->getBoolOption( 'showhiddencats' ) ||
+                                               $this->mTitle->getNamespace() == NS_CATEGORY;
 
-               if( strpos( $catlinks, '<div id="mw-normal-catlinks">' ) === false ) {
+               if( empty($allCats['normal']) && !( !empty($allCats['hidden']) && $showHidden ) ) {
                        $classes .= ' catlinks-allhidden';
                }