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".
This commit is contained in:
parent
c2ca497c2a
commit
fa214f77d9
2 changed files with 26 additions and 1 deletions
|
|
@ -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 ===
|
||||
|
||||
|
|
|
|||
|
|
@ -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><" ) {
|
||||
$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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue