From 10bfbe1aeca87fc7938b9007d1faa141d5fa7d87 Mon Sep 17 00:00:00 2001
From: Brion Vibber
Date: Tue, 9 Sep 2003 05:46:22 +0000
Subject: [PATCH] View source in read-only message when db is locked
---
includes/EditPage.php | 2 +-
includes/OutputPage.php | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 7f430d6204..f85a42420b 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -42,7 +42,7 @@ class EditPage {
if( isset( $wpSave ) or isset( $wpPreview ) ) {
$this->editForm( "preview" );
} else {
- $wgOut->readOnlyPage();
+ $wgOut->readOnlyPage( $this->mArticle->getContent() );
}
return;
}
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 849fb84d6f..f43d8d4962 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -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 .= "
\n";
+ }
+
$this->addHTML( $text );
$this->returnToMain( false );
}
--
2.20.1