From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/specials/SpecialRevisiondelete.php | 34 ++++++++++++----------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'includes/specials/SpecialRevisiondelete.php') diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 7eea71da..9e2ca277 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -132,18 +132,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { // $this->ids = array_map( 'intval', $this->ids ); $this->ids = array_unique( array_filter( $this->ids ) ); - if ( $request->getVal( 'action' ) == 'historysubmit' - || $request->getVal( 'action' ) == 'revisiondelete' - ) { - // For show/hide form submission from history page - // Since we are access through index.php?title=XXX&action=historysubmit - // getFullTitle() will contain the target title and not our title - $this->targetObj = $this->getFullTitle(); - $this->typeName = 'revision'; - } else { - $this->typeName = $request->getVal( 'type' ); - $this->targetObj = Title::newFromText( $request->getText( 'target' ) ); - } + $this->typeName = $request->getVal( 'type' ); + $this->targetObj = Title::newFromText( $request->getText( 'target' ) ); # For reviewing deleted files... $this->archiveName = $request->getVal( 'file' ); @@ -293,6 +283,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { * Show a deleted file version requested by the visitor. * @todo Mostly copied from Special:Undelete. Refactor. * @param string $archiveName + * @throws MWException + * @throws PermissionsError */ protected function tryShowFile( $archiveName ) { $repo = RepoGroup::singleton()->getLocalRepo(); @@ -372,10 +364,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $userAllowed = true; // Messages: revdelete-selected-text, revdelete-selected-file, logdelete-selected - $this->getOutput()->wrapWikiMsg( "$1", array( $this->typeLabels['selected'], + $out = $this->getOutput(); + $out->wrapWikiMsg( "$1", array( $this->typeLabels['selected'], $this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) ); - $this->getOutput()->addHTML( "" ); // Explanation text $this->addUsageText(); @@ -411,7 +405,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { // Show form if the user can submit if ( $this->mIsAllowed ) { - $out = Xml::openElement( 'form', array( 'method' => 'post', + $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ), 'id' => 'mw-revdel-form-revisions' ) ) . Xml::fieldset( $this->msg( 'revdelete-legend' )->text() ) . @@ -463,12 +457,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { array(), array( 'action' => 'edit' ) ); - $out .= Xml::tags( 'p', array( 'class' => 'mw-revdel-editreasons' ), $link ) . "\n"; + $form .= Xml::tags( 'p', array( 'class' => 'mw-revdel-editreasons' ), $link ) . "\n"; } } else { - $out = ''; + $form = ''; } - $this->getOutput()->addHTML( $out ); + $out->addHTML( $form ); } /** -- cgit v1.2.2