From: Magnus Manske Date: Sun, 8 Jan 2006 19:53:20 +0000 (+0000) Subject: Fix for bug 4469: Implement MediaWiki::Sitenotice X-Git-Tag: 1.6.0~673 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=6b7ef22b7b4b957c13b446762e8e051dec6d1f41;p=lhc%2Fweb%2Fwiklou.git Fix for bug 4469: Implement MediaWiki::Sitenotice 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) --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9349499a02..1f0408f783 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1367,6 +1367,18 @@ function wfGetSiteNotice() { } } } + + # Namespacebanner + $key = wfMsg('namespacebanner') ; + $ns = $wgTitle->getNsText() . '-' ; + if ( $ns != "" ) { + $key .= str_replace ( '_' , '-' , $ns ) ; + } + $nsbanner = wfMsg ( $key ) ; + if ( $nsbanner != "<".$key.">" ) { + $notice .= '
' . $nsbanner . "
" ; + } + wfProfileOut( $fname ); return $notice; } diff --git a/languages/Language.php b/languages/Language.php index cef6407ddc..6956f134b4 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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',