View source in read-only message when db is locked
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 9 Sep 2003 05:46:22 +0000 (05:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 9 Sep 2003 05:46:22 +0000 (05:46 +0000)
includes/EditPage.php
includes/OutputPage.php

index 7f430d6..f85a424 100644 (file)
@@ -42,7 +42,7 @@ class EditPage {
                        if( isset( $wpSave ) or isset( $wpPreview ) ) {
                                $this->editForm( "preview" );
                        } else {
-                               $wgOut->readOnlyPage();
+                               $wgOut->readOnlyPage( $this->mArticle->getContent() );
                        }
                        return;
                }
index 849fb84..f43d8d4 100644 (file)
@@ -488,7 +488,7 @@ class OutputPage {
                exit();
        }
 
-       function readOnlyPage()
+       function readOnlyPage( $source = "" )
        {
                global $wgUser, $wgReadOnlyFile;
 
@@ -498,6 +498,14 @@ class OutputPage {
 
                $reason = implode( "", file( $wgReadOnlyFile ) );
                $text = str_replace( "$1", $reason, wfMsg( "readonlytext" ) );
+               
+               if($source) {
+                       $rows = $wgUser->getOption( "rows" );
+                       $cols = $wgUser->getOption( "cols" );
+                       $text .= "</p>\n<textarea cols='$cols' rows='$rows' readonly>" .
+                               htmlspecialchars( $source ) . "\n</textarea>";
+               }
+               
                $this->addHTML( $text );
                $this->returnToMain( false );
        }