Add help link to three other "minor" special pages
authorFederico Leva <federicoleva@tiscali.it>
Wed, 4 Mar 2015 23:14:50 +0000 (00:14 +0100)
committerFederico Leva <federicoleva@tiscali.it>
Wed, 18 Mar 2015 13:21:16 +0000 (14:21 +0100)
Bug: T45591
Change-Id: If8efa314fbd8f7469aa018135ad0f611f8806b48

includes/specials/SpecialDiff.php
includes/specials/SpecialRandomInCategory.php
includes/specials/SpecialRevisiondelete.php

index 77d2317..799e526 100644 (file)
@@ -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' );
                }
 
index 69436bf..b6f19ec 100644 (file)
@@ -68,6 +68,8 @@ class SpecialRandomInCategory extends FormSpecialPage {
        }
 
        protected function getFormFields() {
+               $this->getOutput()->addHelpLink( 'Help:RandomInCategory' );
+
                $form = array(
                        'category' => array(
                                'type' => 'text',
index 7a350c7..e0a964e 100644 (file)
@@ -374,10 +374,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>" );
+               $out->addHelpLink( 'Help:RevisionDelete' );
+               $out->addHTML( "<ul>" );
 
                $numRevisions = 0;
                // Live revisions...
@@ -395,14 +397,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();
 
@@ -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 );
        }
 
        /**