Fix for bug 4469: Implement MediaWiki:<namespace>:Sitenotice
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Sun, 8 Jan 2006 19:53:20 +0000 (19:53 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Sun, 8 Jan 2006 19:53:20 +0000 (19:53 +0000)
MediaWiki:Namespacebanner contains the "base name", to which the name of the namespace is appended, like "basename-namespace". By default the base name is also "Namespacebanner" to add confusion. In namespace names, spaces are replaced by "-" (due to some weird message handling bug).
So the namespace-specific notice messages loke like:
"Namespacebanner-" (main namespace)
"Namespacebanner-Talk" (Talk namespace)
"Namespacebanner-MediaWiki-talk" (for MediaWiki_talk)

includes/GlobalFunctions.php
languages/Language.php

index 9349499..1f0408f 100644 (file)
@@ -1367,6 +1367,18 @@ function wfGetSiteNotice() {
                        }
                }
        }
+       
+       # Namespacebanner
+       $key = wfMsg('namespacebanner') ;
+       $ns = $wgTitle->getNsText() . '-' ;
+       if ( $ns != "" ) {
+               $key .= str_replace ( '_' , '-' , $ns ) ;
+       }
+       $nsbanner = wfMsg ( $key ) ;
+       if ( $nsbanner != "&lt;".$key."&gt;" ) {
+               $notice .= '<div id="namespacebanner">' . $nsbanner . "</div>" ;
+       }
+       
        wfProfileOut( $fname );
        return $notice;
 }
index cef6407..6956f13 100644 (file)
@@ -505,6 +505,7 @@ See $1.',
 'restorelink' => '$1 deleted edits',
 'feedlinks' => 'Feed:',
 'sitenotice'   => '-', # the equivalent to wgSiteNotice
+'namespacebanner'      => 'Namespacebanner',
 
 # Short words for each namespace, by default used in the 'article' tab in monobook
 'nstab-main' => 'Article',