From 9e60a2cc7e0660679ee69fa6896472729a5bd951 Mon Sep 17 00:00:00 2001 From: Federico Leva Date: Thu, 5 Mar 2015 00:14:50 +0100 Subject: [PATCH] Add help link to three other "minor" special pages Bug: T45591 Change-Id: If8efa314fbd8f7469aa018135ad0f611f8806b48 --- includes/specials/SpecialDiff.php | 1 + includes/specials/SpecialRandomInCategory.php | 2 ++ includes/specials/SpecialRevisiondelete.php | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/includes/specials/SpecialDiff.php b/includes/specials/SpecialDiff.php index 77d23173ca..799e526bfb 100644 --- a/includes/specials/SpecialDiff.php +++ b/includes/specials/SpecialDiff.php @@ -53,6 +53,7 @@ class SpecialDiff extends RedirectSpecialPage { $this->mAddedRedirectParams['diff'] = $parts[1]; } else { // Wrong number of parameters, bail out + $this->getOutput()->addHelpLink( 'Help:Diff' ); throw new ErrorPageError( 'nopagetitle', 'nopagetext' ); } diff --git a/includes/specials/SpecialRandomInCategory.php b/includes/specials/SpecialRandomInCategory.php index 69436bf79d..b6f19ec065 100644 --- a/includes/specials/SpecialRandomInCategory.php +++ b/includes/specials/SpecialRandomInCategory.php @@ -68,6 +68,8 @@ class SpecialRandomInCategory extends FormSpecialPage { } protected function getFormFields() { + $this->getOutput()->addHelpLink( 'Help:RandomInCategory' ); + $form = array( 'category' => array( 'type' => 'text', diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 7a350c701c..e0a964e862 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -374,10 +374,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(); @@ -413,7 +415,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() ) . @@ -465,12 +467,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 ); } /** -- 2.20.1