diff --git a/RELEASE-NOTES b/RELEASE-NOTES index da8050d33dd..d1b36842c5e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -578,7 +578,9 @@ fully support the editing toolbar, but was found to be too confusing. * Use revision rate for ETA in dump generation; it tends to be more stable than the per-page count for full-history dumps. * Include timestamp in wfDebugLog breakouts - +* (bug 4469) Namespace-specific notice to be displayed below site-notice + Edit messages like "MediaWiki:Namespacenotice-" plus namespace name + which is blank for main namespace, or like e.g. "User_talk" === Caveats === diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d7901d90c1a..fc5dd5c6271 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1390,6 +1390,28 @@ function wfGetCachedNotice( $name ) { return $notice; } +function wfGetNamespaceNotice() { + global $wgTitle; + + # Paranoia + if ( !isset( $wgTitle ) || !is_object( $wgTitle ) ) + return ""; + + $fname = 'wfGetNamespaceNotice'; + wfProfileIn( $fname ); + + $key = "namespacenotice-" . $wgTitle->getNsText(); + $namespaceNotice = wfGetCachedNotice( $key ); + if ( $namespaceNotice && substr ( $namespaceNotice , 0 ,7 ) != "
<" ) { + $namespaceNotice = '
"; + } else { + $namespaceNotice = ""; + } + + wfProfileOut( $fname ); + return $namespaceNotice; +} + function wfGetSiteNotice() { global $wgUser, $wgSiteNotice; $fname = 'wfGetSiteNotice'; @@ -1407,6 +1429,7 @@ function wfGetSiteNotice() { $siteNotice = $anonNotice; } } + $siteNotice .= wfGetNamespaceNotice(); wfProfileOut( $fname ); return( $siteNotice );