* Displays the file cache if possible
*/
function wfEmergencyAbort( &$conn, $error ) {
- global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgSiteNotice, $wgOutputEncoding;
+ global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgOutputEncoding;
global $wgSitename, $wgServer;
# I give up, Brion is right. Getting the message cache to work when there is no DB is tricky.
header( 'Cache-control: none' );
header( 'Pragma: nocache' );
}
- $msg = $wgSiteNotice;
+ $msg = wfGetSiteNotice();
if($msg == '') {
$msg = str_replace( '$1', $error, $noconnect );
}
}
}
+/**
+ * Swap two variables
+ */
+function swap( &$x, &$y ) {
+ $z = $x;
+ $x = $y;
+ $y = $z;
+}
+
+function wfGetSiteNotice() {
+ global $wgSiteNotice;
+ $fname = 'wfGetSiteNotice';
+ wfProfileIn( $fname );
+
+ $notice = wfMsg( 'sitenotice' );
+ if($notice == '<sitenotice>') $notice = '';
+ # Allow individual wikis to turn it off
+ if ( $notice == '-' ) {
+ $notice = '';
+ } else {
+ if ($notice == '') {
+ $notice = $wgSiteNotice;
+ }
+ if($notice != '-' && $notice != '') {
+ $specialparser = new Parser();
+ $parserOutput = $specialparser->parse( $notice, $wgTitle, $wgOut->mParserOptions, false );
+ $notice = $parserOutput->getText();
+ }
+ }
+ wfProfileOut( $fname );
+ return $notice;
+}
+
?>
$wgTitle = Title::makeTitle( NS_SPECIAL, 'Error' );
$wgArticle = new Article($wgTitle);
-# Site notice
-# FIXME: This is an ugly hack, which wastes runtime on cache hits
-# and raw page views by forcing initialization of the message cache.
-# Try to fake around it for raw at least:
-if( !isset( $_REQUEST['action'] ) || $_REQUEST['action'] != 'raw' ) {
- $notice = wfMsg( 'sitenotice' );
- if($notice == '<sitenotice>') $notice = '';
- # Allow individual wikis to turn it off
- if ( $notice == '-' ) {
- $wgSiteNotice = '';
- } else {
- # if($wgSiteNotice) $notice .= $wgSiteNotice;
- if ($notice == '') {
- $notice = $wgSiteNotice;
- }
- if($notice != '-' && $notice != '') {
- $specialparser = new Parser();
- $parserOutput = $specialparser->parse( $notice, $wgTitle, $wgOut->mParserOptions, false );
- $wgSiteNotice = $parserOutput->getText();
- }
- }
-}
-
wfProfileOut( $fname.'-misc2' );
wfProfileIn( $fname.'-extensions' );
}
function doBeforeContent() {
- global $wgOut, $wgTitle, $wgContLang, $wgSiteNotice;
+ global $wgOut, $wgTitle, $wgContLang;
$fname = 'Skin::doBeforeContent';
wfProfileIn( $fname );
$s .= "</tr>\n</table>\n</div>\n";
$s .= "\n<div id='article'>\n";
- if( $wgSiteNotice ) {
- $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+ $notice = wfGetSiteNotice();
+ if( $notice ) {
+ $s .= "\n<div id='siteNotice'>$notice</div>\n";
}
$s .= $this->pageTitle();
$s .= $this->pageSubtitle() ;
global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode, $wgUseNewInterlanguage;
global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
- global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
+ global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
$tpl->setRef( 'debug', $out->mDebugtext );
$tpl->set( 'reporttime', $out->reportTime() );
- $tpl->set( 'sitenotice', $wgSiteNotice );
- $tpl->set( 'tagline', wfMsg('tagline') );
+ $tpl->set( 'sitenotice', wfGetSiteNotice() );
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
$out->mBodytext .= $printfooter ;
}
function doBeforeContent() {
- global $wgOut, $wgTitle, $wgSiteNotice;
+ global $wgOut, $wgTitle;
$s = "";
$qb = $this->qbSetting();
$s .= "\n</div>\n<div id='article'>";
- if( $wgSiteNotice ) {
- $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+ $notice = wfGetSiteNotice();
+ if( $notice ) {
+ $s .= "\n<div id='siteNotice'>$notice</div>\n";
}
$s .= $this->pageTitle();
$s .= $this->pageSubtitle() . "\n";
}
function doBeforeContent() {
- global $wgUser, $wgOut, $wgTitle, $wgSiteNotice;
+ global $wgUser, $wgOut, $wgTitle;
$s = "\n<div id='content'>\n<div id='topbar'>";
$s .= $this->logoText( "right" );
$s .= $this->pageSubtitle() . "\n";
$s .= $this->topLinks() . "\n<br />";
- if( $wgSiteNotice ) {
- $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+
+ $notice = wfGetSiteNotice();
+ if( $notice ) {
+ $s .= "\n<div id='siteNotice'>$notice</div>\n";
}
$s .= $this->pageTitleLinks();