r12898 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12897‎ | r12898 | r12899 >
Date:17:36, 28 January 2006
Author:magnus_manske
Status:old
Tags:
Comment:
Namespace notice (fix for bug 4469) is back:
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".
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1390,6 +1390,28 @@
13911391 return $notice;
13921392 }
13931393
 1394+function wfGetNamespaceNotice() {
 1395+ global $wgTitle;
 1396+
 1397+ # Paranoia
 1398+ if ( !isset( $wgTitle ) || !is_object( $wgTitle ) )
 1399+ return "";
 1400+
 1401+ $fname = 'wfGetNamespaceNotice';
 1402+ wfProfileIn( $fname );
 1403+
 1404+ $key = "namespacenotice-" . $wgTitle->getNsText();
 1405+ $namespaceNotice = wfGetCachedNotice( $key );
 1406+ if ( $namespaceNotice && substr ( $namespaceNotice , 0 ,7 ) != "<p>&lt;" ) {
 1407+ $namespaceNotice = '<div id="namespacebanner">' . $namespaceNotice . "</div>";
 1408+ } else {
 1409+ $namespaceNotice = "";
 1410+ }
 1411+
 1412+ wfProfileOut( $fname );
 1413+ return $namespaceNotice;
 1414+}
 1415+
13941416 function wfGetSiteNotice() {
13951417 global $wgUser, $wgSiteNotice;
13961418 $fname = 'wfGetSiteNotice';
@@ -1407,6 +1429,7 @@
14081430 $siteNotice = $anonNotice;
14091431 }
14101432 }
 1433+ $siteNotice .= wfGetNamespaceNotice();
14111434
14121435 wfProfileOut( $fname );
14131436 return( $siteNotice );
Index: trunk/phase3/RELEASE-NOTES
@@ -578,8 +578,10 @@
579579 * Use revision rate for ETA in dump generation; it tends to be more stable
580580 than the per-page count for full-history dumps.
581581 * Include timestamp in wfDebugLog breakouts
 582+* (bug 4469) Namespace-specific notice to be displayed below site-notice
 583+ Edit messages like "MediaWiki:Namespacenotice-" plus namespace name
 584+ which is blank for main namespace, or like e.g. "User_talk"
582585
583 -
584586 === Caveats ===
585587
586588 Some output, particularly involving user-supplied inline HTML, may not

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r12531Fix for bug 4469: Implement MediaWiki:<namespace>:Sitenotice...magnus_manske19:53, 8 January 2006

Status & tagging log