* Add a message if category is empty
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 16 Jul 2007 15:15:26 +0000 (15:15 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 16 Jul 2007 15:15:26 +0000 (15:15 +0000)
RELEASE-NOTES
includes/CategoryPage.php
languages/messages/MessagesDe.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 6ef808c..9a21194 100644 (file)
@@ -142,6 +142,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   compatibility
 * Introduced 'ContributionsToolLinks' hook; see docs/hooks.txt for more
   information
+* Add a message if category is empty
 
 == Bugfixes since 1.10 ==
 
index 426fbb1..435a3f4 100644 (file)
@@ -90,6 +90,11 @@ class CategoryViewer {
                        $this->getImageSection() .
                        $this->getCategoryBottom();
 
+               // Give a proper message if category is empty
+               if ( $r == '' ) {
+                       $r = wfMsgExt( 'category-empty', array( 'parse' ) );
+               }
+
                wfProfileOut( __METHOD__ );
                return $r;
        }
@@ -229,13 +234,15 @@ class CategoryViewer {
        }
 
        function getCategoryTop() {
-               $r = "<br style=\"clear:both;\"/>\n";
+               $r = '';
                if( $this->until != '' ) {
                        $r .= $this->pagingLinks( $this->title, $this->nextPage, $this->until, $this->limit );
                } elseif( $this->nextPage != '' || $this->from != '' ) {
                        $r .= $this->pagingLinks( $this->title, $this->from, $this->nextPage, $this->limit );
                }
-               return $r;
+               return $r == ''
+                       ? $r
+                       : "<br style=\"clear:both;\"/>\n" . $r;
        }
 
        function getSubcategorySection() {
index e7d9521..ff997ad 100644 (file)
@@ -253,6 +253,7 @@ $messages = array(
 'category_header'       => 'Seiten in der Kategorie „$1“',
 'subcategories'         => 'Unterkategorien',
 'category-media-header' => 'Medien in der Kategorie „$1“',
+'category-empty'        => "''Diese Kategorie enthält zur Zeit keine Artikel oder Medien.''",
 
 'mainpagetext'      => 'MediaWiki wurde erfolgreich installiert.',
 'mainpagedocfooter' => 'Hilfe zur Benutzung und Konfiguration der Wiki Software finden Sie im [http://meta.wikimedia.org/wiki/Help:Contents Benutzerhandbuch].
index 87c291a..5f7aa3e 100644 (file)
@@ -562,6 +562,7 @@ XHTML id names.
 'category_header'       => 'Articles in category "$1"',
 'subcategories'         => 'Subcategories',
 'category-media-header' => 'Media in category "$1"',
+'category-empty'        => "''This category contains currently no articles or media.''",
 
 'linkprefix'        => '/^(.*?)([a-zA-Z\x80-\xff]+)$/sD', # only translate this message to other languages if you have to change it
 'mainpagetext'      => "<big>'''MediaWiki has been successfully installed.'''</big>",
index 2351877..439ef53 100644 (file)
@@ -118,6 +118,7 @@ $wgMessageStructure = array(
                'category_header',
                'subcategories',
                'category-media-header',
+               'category-empty',
        ),
        'mainpage' => array(
                'linkprefix',