Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -103,7 +103,8 @@ |
104 | 104 | $this->editFormTextBeforeContent = |
105 | 105 | $this->editFormTextAfterWarn = |
106 | 106 | $this->editFormTextAfterTools = |
107 | | - $this->editFormTextBottom = ""; |
| 107 | + $this->editFormTextBottom = |
| 108 | + $this->mPreloadText = ""; |
108 | 109 | } |
109 | 110 | |
110 | 111 | function getArticle() { |
— | — | @@ -200,6 +201,11 @@ |
201 | 202 | wfProfileOut( __METHOD__ ); |
202 | 203 | return $text; |
203 | 204 | } |
| 205 | + |
| 206 | + /** Use this method before edit() to preload some text into the edit box */ |
| 207 | + public function setPreloadedText( $text ) { |
| 208 | + $this->mPreloadText = $text; |
| 209 | + } |
204 | 210 | |
205 | 211 | /** |
206 | 212 | * Get the contents of a page from its title and remove includeonly tags |
— | — | @@ -208,7 +214,9 @@ |
209 | 215 | * @return string The contents of the page. |
210 | 216 | */ |
211 | 217 | protected function getPreloadedText( $preload ) { |
212 | | - if ( $preload === '' ) { |
| 218 | + if ( !empty($this->mPreloadText) ) { |
| 219 | + return $this->mPreloadText; |
| 220 | + } elseif ( $preload === '' ) { |
213 | 221 | return ''; |
214 | 222 | } else { |
215 | 223 | $preloadTitle = Title::newFromText( $preload ); |
Index: trunk/extensions/LiquidThreads/classes/LqtView.php |
— | — | @@ -365,6 +365,24 @@ |
366 | 366 | Xml::inputLabel( $subject_label, 'lqt_subject_field', 'lqt_subject_field', |
367 | 367 | 60, $subject, $disableattr ) . Xml::element( 'br' ); |
368 | 368 | } |
| 369 | + |
| 370 | + // Quote the original message if we're replying |
| 371 | + if ( $edit_type == 'reply' ) { |
| 372 | + global $wgContLang; |
| 373 | + |
| 374 | + $thread_article = new Post( $edit_applies_to->title() ); |
| 375 | + |
| 376 | + $quote_text = $thread_article->getContent(); |
| 377 | + $timestamp = $edit_applies_to->created(); |
| 378 | + $fTime = $wgContLang->time($timestamp); |
| 379 | + $fDate = $wgContLang->date($timestamp); |
| 380 | + $user = $thread_article->originalAuthor()->getName(); |
| 381 | + |
| 382 | + $quoteIntro = wfMsgForContent( 'lqt-quote-intro', $user, $fTime, $fDate ); |
| 383 | + $quote_text = "$quoteIntro\n<blockquote>\n$quote_text\n</blockquote>\n"; |
| 384 | + |
| 385 | + $e->setPreloadedText( $quote_text ); |
| 386 | + } |
369 | 387 | |
370 | 388 | $e->edit(); |
371 | 389 | |
Index: trunk/extensions/LiquidThreads/Lqt.i18n.php |
— | — | @@ -169,6 +169,9 @@ |
170 | 170 | was created on $3 at $4. |
171 | 171 | |
172 | 172 | You can see it at <$6>", |
| 173 | + |
| 174 | + // Quoting functionality |
| 175 | + 'lqt-quote-intro' => 'On $2 at $3, [[User:$1]] wrote:', |
173 | 176 | ); |
174 | 177 | |
175 | 178 | /** Message documentation (Message documentation) |