(bug 7892) Add media count to category page, à la subcats/pages. Used a new count...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 24 Nov 2006 06:41:02 +0000 (06:41 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 24 Nov 2006 06:41:02 +0000 (06:41 +0000)
RELEASE-NOTES
includes/CategoryPage.php
includes/ImageGallery.php
languages/messages/MessagesEn.php

index ac50b1d..1d8b8c7 100644 (file)
@@ -176,7 +176,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   warning and a request to upgrade.
 * (bug 6440) Updated indexes to improve backlinking queries (links, templates, images)
 * Switched 'anon-only' block mode to default for IP blocks
-* (bug 3687) Add distinct heading for media files in category display.
+* (bug 3687, 7892) Add distinct heading for media files in category display,
+  with count.
 * (bug 1578) Add different icons for external links to audio, video, or PDF in
   Monobook.
 * Made autoblocks block account creation if the user block has that option enabled.
@@ -210,7 +211,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   image page (image/svg+xml, not image/svg).
 * (bug 7883) Added autoblock whitelisting feature, using which specific ranges
    can be protected from autoblocking. These ranges are specified, in list format,
-   in the autoblock_whitelist system message. 
+   in the autoblock_whitelist system message.
 * Added placeholders for text injection by hooks to EditPage.php
 
 == Languages updated ==
index 2069ebb..0086a2f 100644 (file)
@@ -259,6 +259,7 @@ class CategoryViewer {
                if( $this->showGallery && ! $this->gallery->isEmpty() ) {
                        return "<div id=\"mw-category-media\">\n" .
                        '<h2>' . wfMsg( 'category-media-header', htmlspecialchars($this->title->getText()) ) . "</h2>\n" .
+                       wfMsgExt( 'category-media-count', array( 'parse' ), $this->gallery->count() ) .
                        $this->gallery->toHTML() . "\n</div>";
                } else {
                        return '';
index 7ff456b..dfd5a98 100644 (file)
@@ -206,6 +206,13 @@ class ImageGallery
 
                return $s;
        }
+       
+       /**
+        * @return int Number of images in the gallery
+        */
+       public function count() {
+               return count( $this->mImages );
+       }
 
 } //class
 ?>
index 846e256..1b4f657 100644 (file)
@@ -2056,6 +2056,7 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]]
 'spamprotectionmatch' => 'The following text is what triggered our spam filter: $1',
 'subcategorycount' => "There {{PLURAL:$1|is one subcategory|are $1 subcategories}} to this category.",
 'categoryarticlecount' => "There {{PLURAL:$1|is one article|are $1 articles}} in this category.",
+'category-media-count' => "There {{PLURAL:$1|is one file|are $1 files}} in this category.",
 'listingcontinuesabbrev' => " cont.",
 'spambot_username' => 'MediaWiki spam cleanup',
 'spam_reverting' => 'Reverting to last version not containing links to $1',