LiquidThreads updates:
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 16 Jul 2009 15:20:13 +0000 (15:20 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 16 Jul 2009 15:20:13 +0000 (15:20 +0000)
* Overhaul deletion system. Totally remove deletion special page, deletion will now be handled through the standard MediaWiki deletion system. When a thread's "root" is deleted, the thread itself is marked as deleted. When the page is re-undeleted, the thread will be marked as restored.
* Move some class files from Lqt* to simply *.
* Remove HistoryIterator class, pointless.
* Miscellaneous code quality as found.

Includes core changes to pass comment along with ArticleRevisionUndeleted hook.

docs/hooks.txt
includes/specials/SpecialUndelete.php

index d3a70a6..c2e73f5 100644 (file)
@@ -463,6 +463,7 @@ $baseRevId: the rev ID (or false) this edit was based on
 $title: Title corresponding to the article restored
 $create: Whether or not the restoration caused the page to be created
 (i.e. it didn't exist before)
+$comment: The comment associated with the undeletion.
 
 'ArticleUpdateBeforeRedirect': After a page is updated (usually on save),
 before the user is redirected back to the page
index d8c9d13..f713fe4 100644 (file)
@@ -332,7 +332,7 @@ class PageArchive {
                }
 
                if( $restoreText ) {
-                       $textRestored = $this->undeleteRevisions( $timestamps, $unsuppress );
+                       $textRestored = $this->undeleteRevisions( $timestamps, $unsuppress, $comment );
                        if($textRestored === false) // It must be one of UNDELETE_*
                                return false;
                } else {
@@ -377,7 +377,7 @@ class PageArchive {
         *
         * @return mixed number of revisions restored or false on failure
         */
-       private function undeleteRevisions( $timestamps, $unsuppress = false ) {
+       private function undeleteRevisions( $timestamps, $unsuppress = false, $comment = '' ) {
                if ( wfReadOnly() )
                        return false;
                $restoreAll = empty( $timestamps );
@@ -510,10 +510,10 @@ class PageArchive {
                        }
 
                        if( $newid ) {
-                               wfRunHooks( 'ArticleUndelete', array( &$this->title, true ) );
+                               wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) );
                                Article::onArticleCreate( $this->title );
                        } else {
-                               wfRunHooks( 'ArticleUndelete', array( &$this->title, false ) );
+                               wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) );
                                Article::onArticleEdit( $this->title );
                        }