Namespace notice (fix for bug 4469) is back:
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Sat, 28 Jan 2006 17:36:08 +0000 (17:36 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Sat, 28 Jan 2006 17:36:08 +0000 (17:36 +0000)
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".

RELEASE-NOTES
includes/GlobalFunctions.php

index da8050d..d1b3684 100644 (file)
@@ -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 ===
 
index d7901d9..fc5dd5c 100644 (file)
@@ -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 ) != "<p>&lt;" ) {
+                $namespaceNotice = '<div id="namespacebanner">' . $namespaceNotice . "</div>";
+       } 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 );