Following r100264, update usages in core
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
index 9518e19..9f15fc2 100644 (file)
@@ -111,17 +111,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        }
 
        public function execute( $par ) {
+               $this->checkPermissions();
+               $this->checkReadOnly();
+
                $output = $this->getOutput();
                $user = $this->getUser();
 
-               if( !$user->isAllowed( 'deletedhistory' ) ) {
-                       throw new PermissionsError( 'deletedhistory' );
-               } elseif( wfReadOnly() ) {
-                       throw new ReadOnlyError;
-               } elseif( $user->isBlocked() ) {
-                       throw new UserBlockedError( $user->getBlock() );
-               }
-
                $this->mIsAllowed = $user->isAllowed('deleterevision'); // for changes
                $this->setHeaders();
                $this->outputHeader();
@@ -208,12 +203,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                # Show relevant lines from the deletion log
                $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
                LogEventsList::showLogExtract( $output, 'delete',
-                       $this->targetObj->getPrefixedText(), '', array( 'lim' => 25, 'conds' => $qc ) );
+                       $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
                # Show relevant lines from the suppression log
                if( $user->isAllowed( 'suppressionlog' ) ) {
                        $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
                        LogEventsList::showLogExtract( $output, 'suppress',
-                               $this->targetObj->getPrefixedText(), '', array( 'lim' => 25, 'conds' => $qc ) );
+                               $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
                }
        }
 
@@ -230,7 +225,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                array(),
                                array( 'page' => $this->targetObj->getPrefixedText() )
                        );
-                       if ( $this->targetObj->getNamespace() != NS_SPECIAL ) {
+                       if ( !$this->targetObj->isSpecialPage() ) {
                                # Give a link to the page history
                                $links[] = Linker::linkKnown(
                                        $this->targetObj,
@@ -250,7 +245,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                }
                        }
                        # Logs themselves don't have histories or archived revisions
-                       $this->getOutput()->setSubtitle( '<p>' . $this->getLang()->pipeList( $links ) . '</p>' );
+                       $this->getOutput()->addSubtitle( $this->getLang()->pipeList( $links ) );
                }
        }
 
@@ -280,7 +275,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $this->getOutput()->addWikiMsg( 'revdelete-no-file' );
                        return;
                }
-               if( !$oimage->userCan(File::DELETED_FILE) ) {
+               if( !$oimage->userCan( File::DELETED_FILE, $this->getUser() ) ) {
                        if( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
                                $this->getOutput()->permissionRequired( 'suppressrevision' );
                        } else {
@@ -299,7 +294,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                        'action' => $this->getTitle()->getLocalUrl(
                                                'target=' . urlencode( $oimage->getName() ) .
                                                '&file=' . urlencode( $archiveName ) .
-                                               '&token=' . urlencode( $this->getUser()->editToken( $archiveName ) ) )
+                                               '&token=' . urlencode( $this->getUser()->getEditToken( $archiveName ) ) )
                                        )
                                ) .
                                Xml::submitButton( wfMsg( 'revdelete-show-file-submit' ) ) .
@@ -409,7 +404,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                        '</td>' .
                                "</tr>\n" .
                                Xml::closeElement( 'table' ) .
-                               Html::hidden( 'wpEditToken', $this->getUser()->editToken() ) .
+                               Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() ) .
                                Html::hidden( 'target', $this->targetObj->getPrefixedText() ) .
                                Html::hidden( 'type', $this->typeName ) .
                                Html::hidden( 'ids', implode( ',', $this->ids ) ) .
@@ -540,7 +535,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Report that the submit operation succeeded
         */
        protected function success() {
-               $this->getOutput()->setPagetitle( wfMsg( 'actioncomplete' ) );
+               $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
                $this->getOutput()->wrapWikiMsg( "<span class=\"success\">\n$1\n</span>", $this->typeInfo['success'] );
                $this->list->reloadFromMaster();
                $this->showForm();
@@ -550,7 +545,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Report that the submit operation failed
         */
        protected function failure( $status ) {
-               $this->getOutput()->setPagetitle( wfMsg( 'actionfailed' ) );
+               $this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
                $this->getOutput()->addWikiText( $status->getWikiText( $this->typeInfo['failure'] ) );
                $this->showForm();
        }