From bff2477d742d81ad135081570284af5d66bdbb51 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 18 Jun 2009 17:41:33 +0000 Subject: [PATCH] Add quoting functionality to LQT reply view --- includes/EditPage.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 7477698161..d3732b0775 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -103,7 +103,8 @@ class EditPage { $this->editFormTextBeforeContent = $this->editFormTextAfterWarn = $this->editFormTextAfterTools = - $this->editFormTextBottom = ""; + $this->editFormTextBottom = + $this->mPreloadText = ""; } function getArticle() { @@ -200,6 +201,11 @@ class EditPage { wfProfileOut( __METHOD__ ); return $text; } + + /** Use this method before edit() to preload some text into the edit box */ + public function setPreloadedText( $text ) { + $this->mPreloadText = $text; + } /** * Get the contents of a page from its title and remove includeonly tags @@ -208,7 +214,9 @@ class EditPage { * @return string The contents of the page. */ protected function getPreloadedText( $preload ) { - if ( $preload === '' ) { + if ( !empty($this->mPreloadText) ) { + return $this->mPreloadText; + } elseif ( $preload === '' ) { return ''; } else { $preloadTitle = Title::newFromText( $preload ); -- 2.20.1