Tweak outputHeader to allow overriding of summary message key.
authorRaimond Spekking <raymond@users.mediawiki.org>
Fri, 27 Feb 2009 09:07:08 +0000 (09:07 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Fri, 27 Feb 2009 09:07:08 +0000 (09:07 +0000)
Useful for extensions to stick with the naming conventions of message keys: 'extensionname-xxx'

includes/SpecialPage.php

index 70938e6..c44f44d 100644 (file)
@@ -753,10 +753,22 @@ class SpecialPage
                }
        }
 
-       function outputHeader() {
+       /**
+        * Outputs a summary message on top of special pages
+        * Per default the message key is the canonical name of the special page
+        * May be overriden, i.e. by extensions to stick with the naming conventions
+        * for message keys: 'extensionname-xxx' 
+        *
+        * @param string message key of the summary
+        */
+       function outputHeader( $summaryMessageKey = '' ) {
                global $wgOut, $wgContLang;
 
-               $msg = $wgContLang->lc( $this->name() ) . '-summary';
+               if( $summaryMessageKey == '' ) {
+                       $msg = $wgContLang->lc( $this->name() ) . '-summary';
+               } else {
+                       $msg = $summaryMessageKey;
+               }
                $out = wfMsgNoTrans( $msg );
                if ( ! wfEmptyMsg( $msg, $out ) and  $out !== '' and ! $this->including() ) {
                        $wgOut->wrapWikiMsg( "<div class='mw-specialpage-summary'>\n$1</div>", $msg );