View source in read-only message when db is locked

This commit is contained in:
Brion Vibber 2003-09-09 05:46:22 +00:00
parent 62536406e2
commit 10bfbe1aec
2 changed files with 10 additions and 2 deletions

View 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;
}

View 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 );
}