summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialRevisiondelete.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /includes/specials/SpecialRevisiondelete.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'includes/specials/SpecialRevisiondelete.php')
-rw-r--r--includes/specials/SpecialRevisiondelete.php34
1 files changed, 14 insertions, 20 deletions
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( "<strong>$1</strong>", array( $this->typeLabels['selected'],
+ $out = $this->getOutput();
+ $out->wrapWikiMsg( "<strong>$1</strong>", array( $this->typeLabels['selected'],
$this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) );
- $this->getOutput()->addHTML( "<ul>" );
+ $this->addHelpLink( 'Help:RevisionDelete' );
+ $out->addHTML( "<ul>" );
$numRevisions = 0;
// Live revisions...
@@ -393,14 +387,14 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
}
$numRevisions++;
- $this->getOutput()->addHTML( $item->getHTML() );
+ $out->addHTML( $item->getHTML() );
}
if ( !$numRevisions ) {
throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
}
- $this->getOutput()->addHTML( "</ul>" );
+ $out->addHTML( "</ul>" );
// 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 );
}
/**