$wgExternalLinkTarget
* api.php now sends "Retry-After" and "X-Database-Lag" HTTP headers if the maxlag
check fails, just like index.php does
+* Configurable per-namespace and per-page header,
+ respectively MediaWiki:Pageheader-# where # is the namespace number, and
+ MediaWiki:Pagenumber-#-PAGENAME where # is the page's namespace number and
+ PAGENAME is the page name minus the namespace prefix. Can be disabled with the new magic word __NOHEADER__
=== Bug fixes in 1.14 ===
$wasRedirected = true;
}
}
+
+ # Optional notices on a per-namespace and per-page basis
+ $mw = MagicWord::get( 'noheader' );
+ $ignoreheader = false;
+ $text = $this->getContent();
+ if( $mw->match( $text ) ) {
+ $ignoreheader = true;
+ }
+ $pageheader_ns = 'pageheader-'.$this->mTitle->getNamespace();
+ $pageheader_page = $pageheader_ns.'-'.$this->mTitle->getDBkey();
+ if ( !wfEmptyMsg( $pageheader_ns, wfMsgForContent( $pageheader_ns ) ) && !$ignoreheader ) {
+ $wgOut->addWikiText( wfMsgForContent( $pageheader_ns ) );
+ }
+
+ if ( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) && !$ignoreheader ) {
+ $parts = explode( '/', $this->mTitle->getDBkey() );
+ $pageheader_base = $pageheader_ns;
+ while ( count( $parts ) > 0 ) {
+ $pageheader_base .= '-'.array_shift( $parts );
+ if ( !wfEmptyMsg( $pageheader_base, wfMsgForContent( $pageheader_base ) ) ) {
+ $wgOut->addWikiText( wfMsgForContent( $pageheader_base ) );
+ }
+ }
+ } else if ( !wfEmptyMsg( $pageheader_page, wfMsgForContent( $pageheader_page ) ) && !$ignoreheader ) {
+ $wgOut->addWikiText( wfMsgForContent( $pageheader_page ) );
+ }
$outputDone = false;
wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$pcache ) );
$wgOut->addHtml( '</div>' );
}
}
- $text = $this->getContent();
if ( $text === false ) {
# Failed to load, replace text with error message
$t = $this->mTitle->getPrefixedText();
'forcetoc' => array( 0, '__FORCETOC__' ),
'toc' => array( 0, '__TOC__' ),
'noeditsection' => array( 0, '__NOEDITSECTION__' ),
+ 'noheader' => array( 0, '__NOHEADER__' ),
'currentmonth' => array( 1, 'CURRENTMONTH' ),
'currentmonthname' => array( 1, 'CURRENTMONTHNAME' ),
'currentmonthnamegen' => array( 1, 'CURRENTMONTHNAMEGEN' ),