SpecialResetTokens: Switch to OOUI form
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index 28be790..be77e62 100644 (file)
@@ -46,6 +46,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                $this->setHeaders();
                $this->outputHeader();
+               $this->addHelpLink( 'Help:What links here' );
 
                $opts = new FormOptions();
 
@@ -73,7 +74,9 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                $this->target = Title::newFromURL( $opts->getValue( 'target' ) );
                if ( !$this->target ) {
-                       $out->addHTML( $this->whatlinkshereForm() );
+                       if ( !$this->including() ) {
+                               $out->addHTML( $this->whatlinkshereForm() );
+                       }
 
                        return;
                }
@@ -152,7 +155,9 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        $conds['pagelinks'][] = 'rd_from is NOT NULL';
                }
 
-               $queryFunc = function ( $dbr, $table, $fromCol ) use ( $conds, $target, $limit, $useLinkNamespaceDBFields ) {
+               $queryFunc = function ( $dbr, $table, $fromCol ) use (
+                       $conds, $target, $limit, $useLinkNamespaceDBFields
+               ) {
                        // Read an extra row as an at-end check
                        $queryLimit = $limit + 1;
                        $on = array(
@@ -278,7 +283,11 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                        if ( $row->rd_from && $level < 2 ) {
                                $out->addHTML( $this->listItem( $row, $nt, $target, true ) );
-                               $this->showIndirectLinks( $level + 1, $nt, $this->getConfig()->get( 'MaxRedirectLinksRetrieved' ) );
+                               $this->showIndirectLinks(
+                                       $level + 1,
+                                       $nt,
+                                       $this->getConfig()->get( 'MaxRedirectLinksRetrieved' )
+                               );
                                $out->addHTML( Xml::closeElement( 'li' ) );
                        } else {
                                $out->addHTML( $this->listItem( $row, $nt, $target ) );