r24165 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24164‎ | r24165 | r24166 >
Date:15:15, 16 July 2007
Author:raymond
Status:old
Tags:
Comment:
* Add a message if category is empty
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -118,6 +118,7 @@
119119 'category_header',
120120 'subcategories',
121121 'category-media-header',
 122+ 'category-empty',
122123 ),
123124 'mainpage' => array(
124125 'linkprefix',
Index: trunk/phase3/includes/CategoryPage.php
@@ -90,6 +90,11 @@
9191 $this->getImageSection() .
9292 $this->getCategoryBottom();
9393
 94+ // Give a proper message if category is empty
 95+ if ( $r == '' ) {
 96+ $r = wfMsgExt( 'category-empty', array( 'parse' ) );
 97+ }
 98+
9499 wfProfileOut( __METHOD__ );
95100 return $r;
96101 }
@@ -229,13 +234,15 @@
230235 }
231236
232237 function getCategoryTop() {
233 - $r = "<br style=\"clear:both;\"/>\n";
 238+ $r = '';
234239 if( $this->until != '' ) {
235240 $r .= $this->pagingLinks( $this->title, $this->nextPage, $this->until, $this->limit );
236241 } elseif( $this->nextPage != '' || $this->from != '' ) {
237242 $r .= $this->pagingLinks( $this->title, $this->from, $this->nextPage, $this->limit );
238243 }
239 - return $r;
 244+ return $r == ''
 245+ ? $r
 246+ : "<br style=\"clear:both;\"/>\n" . $r;
240247 }
241248
242249 function getSubcategorySection() {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -562,6 +562,7 @@
563563 'category_header' => 'Articles in category "$1"',
564564 'subcategories' => 'Subcategories',
565565 'category-media-header' => 'Media in category "$1"',
 566+'category-empty' => "''This category contains currently no articles or media.''",
566567
567568 'linkprefix' => '/^(.*?)([a-zA-Z\x80-\xff]+)$/sD', # only translate this message to other languages if you have to change it
568569 'mainpagetext' => "<big>'''MediaWiki has been successfully installed.'''</big>",
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -253,6 +253,7 @@
254254 'category_header' => 'Seiten in der Kategorie „$1“',
255255 'subcategories' => 'Unterkategorien',
256256 'category-media-header' => 'Medien in der Kategorie „$1“',
 257+'category-empty' => "''Diese Kategorie enthält zur Zeit keine Artikel oder Medien.''",
257258
258259 'mainpagetext' => 'MediaWiki wurde erfolgreich installiert.',
259260 'mainpagedocfooter' => 'Hilfe zur Benutzung und Konfiguration der Wiki Software finden Sie im [http://meta.wikimedia.org/wiki/Help:Contents Benutzerhandbuch].
Index: trunk/phase3/RELEASE-NOTES
@@ -142,6 +142,7 @@
143143 compatibility
144144 * Introduced 'ContributionsToolLinks' hook; see docs/hooks.txt for more
145145 information
 146+* Add a message if category is empty
146147
147148 == Bugfixes since 1.10 ==
148149

Follow-up revisions

RevisionCommit summaryAuthorDate
r24215Merged revisions 24095-24212 via svnmerge from...david21:19, 17 July 2007

Status & tagging log