Merge "Convert Special:NewFiles to use OOUI."
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index 81ec4cc..5d230c0 100644 (file)
@@ -360,11 +360,13 @@ class PageArchive {
         * @param array $fileVersions
         * @param bool $unsuppress
         * @param User $user User performing the action, or null to use $wgUser
+        * @param string|string[] $tags Change tags to add to log entry
+        *   ($user should be able to add the specified tags before this is called)
         * @return array(number of file revisions restored, number of image revisions
         *   restored, log message) on success, false on failure.
         */
        function undelete( $timestamps, $comment = '', $fileVersions = [],
-               $unsuppress = false, User $user = null
+               $unsuppress = false, User $user = null, $tags = null
        ) {
                // If both the set of text revisions and file revisions are empty,
                // restore everything. Otherwise, just restore the requested items.
@@ -426,6 +428,7 @@ class PageArchive {
                $logEntry->setPerformer( $user );
                $logEntry->setTarget( $this->title );
                $logEntry->setComment( $reason );
+               $logEntry->setTags( $tags );
 
                Hooks::run( 'ArticleUndeleteLogEntry', [ $this, &$logEntry, $user ] );
 
@@ -695,6 +698,10 @@ class SpecialUndelete extends SpecialPage {
                parent::__construct( 'Undelete', 'deletedhistory' );
        }
 
+       public function doesWrites() {
+               return true;
+       }
+
        function loadRequest( $par ) {
                $request = $this->getRequest();
                $user = $this->getUser();
@@ -865,7 +872,7 @@ class SpecialUndelete extends SpecialPage {
                        "ids" => $revisions,
                        "target" => $this->mTargetObj->getPrefixedText()
                ];
-               $url = SpecialPage::getTitleFor( "RevisionDelete" )->getFullURL( $query );
+               $url = SpecialPage::getTitleFor( 'Revisiondelete' )->getFullURL( $query );
                $this->getOutput()->redirect( $url );
        }