From: Ilmari Karonen Date: Thu, 11 Jan 2007 04:13:11 +0000 (+0000) Subject: make default system messages show on "view source" X-Git-Tag: 1.31.0-rc.0~54510 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=d726e2d29cf9e3b127e0cbdc53fb9120c371e363;p=lhc%2Fweb%2Fwiklou.git make default system messages show on "view source" --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 0d03b6c766..a3ed161d0f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -81,10 +81,13 @@ class EditPage { $text = ''; if( !$this->mTitle->exists() ) { - - # If requested, preload some text. - $text = $this->getPreloadedText( $preload ); - + if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { + # If this is a system message, get the default text. + $text = wfMsgWeirdKey ( $this->mTitle->getText() ) ; + } else { + # If requested, preload some text. + $text = $this->getPreloadedText( $preload ); + } # We used to put MediaWiki:Newarticletext here if # $text was empty at this point. # This is now shown above the edit box instead. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2636d8bb68..085d5f210d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -886,6 +886,8 @@ class OutputPage { global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; $skin = $wgUser->getSkin(); + error_log("readOnlyPage( '$source', '$protected')\n"); + $this->setRobotpolicy( 'noindex,nofollow' ); $this->setArticleRelated( false ); @@ -895,7 +897,7 @@ class OutputPage { # Determine if protection is due to the page being a system message # and show an appropriate explanation - if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) { + if( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { $this->addWikiText( wfMsg( 'protectedinterface' ) ); } else { $this->addWikiText( wfMsg( 'protectedpagetext' ) ); @@ -912,17 +914,8 @@ class OutputPage { if( is_string( $source ) ) { $this->addWikiText( wfMsg( 'viewsourcetext' ) ); - if( $source === '' ) { - global $wgTitle; - if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { - $source = wfMsgWeirdKey ( $wgTitle->getText() ); - } else { - $source = ''; - } - } $rows = $wgUser->getIntOption( 'rows' ); $cols = $wgUser->getIntOption( 'cols' ); - $text = "\n"; $this->addHTML( $text );