make default system messages show on "view source"
authorIlmari Karonen <vyznev@users.mediawiki.org>
Thu, 11 Jan 2007 04:13:11 +0000 (04:13 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Thu, 11 Jan 2007 04:13:11 +0000 (04:13 +0000)
includes/EditPage.php
includes/OutputPage.php

index 0d03b6c..a3ed161 100644 (file)
@@ -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.
index 2636d8b..085d5f2 100644 (file)
@@ -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<textarea name='wpTextbox1' id='wpTextbox1' cols='$cols' rows='$rows' readonly='readonly'>" .
                                htmlspecialchars( $source ) . "\n</textarea>";
                        $this->addHTML( $text );