From 5f1e7225eee1f6d148a17a47212952b8515928ad Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 24 Nov 2006 06:41:02 +0000 Subject: [PATCH] =?utf8?q?(bug=207892)=20Add=20media=20count=20to=20catego?= =?utf8?q?ry=20page,=20=C3=A0=20la=20subcats/pages.=20=20Used=20a=20new=20?= =?utf8?q?count()=20method=20I=20added=20to=20ImageGallery=20class.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- RELEASE-NOTES | 5 +++-- includes/CategoryPage.php | 1 + includes/ImageGallery.php | 7 +++++++ languages/messages/MessagesEn.php | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ac50b1dfc9..1d8b8c7e0f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 2069ebb7dc..0086a2f968 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -259,6 +259,7 @@ class CategoryViewer { if( $this->showGallery && ! $this->gallery->isEmpty() ) { return "
\n" . '

' . wfMsg( 'category-media-header', htmlspecialchars($this->title->getText()) ) . "

\n" . + wfMsgExt( 'category-media-count', array( 'parse' ), $this->gallery->count() ) . $this->gallery->toHTML() . "\n
"; } else { return ''; diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 7ff456b666..dfd5a98b04 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -206,6 +206,13 @@ class ImageGallery return $s; } + + /** + * @return int Number of images in the gallery + */ + public function count() { + return count( $this->mImages ); + } } //class ?> diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 846e256048..1b4f6574a5 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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', -- 2.20.1