Merge "resourceloader: Switch params for private addLink() function"
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index b48e858..18c10bf 100644 (file)
@@ -200,29 +200,27 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        && ( $hidetrans || !$tlRes->numRows() )
                        && ( $hideimages || !$ilRes->numRows() )
                ) {
-                       if ( $level == 0 ) {
-                               if ( !$this->including() ) {
-                                       $out->addHTML( $this->whatlinkshereForm() );
-
-                                       // Show filters only if there are links
-                                       if ( $hidelinks || $hidetrans || $hideredirs || $hideimages ) {
-                                               $out->addHTML( $this->getFilterPanel() );
-                                       }
-                                       $msgKey = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
-                                       $link = $this->getLinkRenderer()->makeLink(
-                                               $this->target,
-                                               null,
-                                               [],
-                                               $this->target->isRedirect() ? [ 'redirect' => 'no' ] : []
-                                       );
-
-                                       $errMsg = $this->msg( $msgKey )
-                                               ->params( $this->target->getPrefixedText() )
-                                               ->rawParams( $link )
-                                               ->parseAsBlock();
-                                       $out->addHTML( $errMsg );
-                                       $out->setStatusCode( 404 );
+                       if ( $level == 0 && !$this->including() ) {
+                               $out->addHTML( $this->whatlinkshereForm() );
+
+                               // Show filters only if there are links
+                               if ( $hidelinks || $hidetrans || $hideredirs || $hideimages ) {
+                                       $out->addHTML( $this->getFilterPanel() );
                                }
+                               $msgKey = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
+                               $link = $this->getLinkRenderer()->makeLink(
+                                       $this->target,
+                                       null,
+                                       [],
+                                       $this->target->isRedirect() ? [ 'redirect' => 'no' ] : []
+                               );
+
+                               $errMsg = $this->msg( $msgKey )
+                                       ->params( $this->target->getPrefixedText() )
+                                       ->rawParams( $link )
+                                       ->parseAsBlock();
+                               $out->addHTML( $errMsg );
+                               $out->setStatusCode( 404 );
                        }
 
                        return;
@@ -280,27 +278,25 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                }
                $lb->execute();
 
-               if ( $level == 0 ) {
-                       if ( !$this->including() ) {
-                               $out->addHTML( $this->whatlinkshereForm() );
-                               $out->addHTML( $this->getFilterPanel() );
+               if ( $level == 0 && !$this->including() ) {
+                       $out->addHTML( $this->whatlinkshereForm() );
+                       $out->addHTML( $this->getFilterPanel() );
 
-                               $link = $this->getLinkRenderer()->makeLink(
-                                       $this->target,
-                                       null,
-                                       [],
-                                       $this->target->isRedirect() ? [ 'redirect' => 'no' ] : []
-                               );
+                       $link = $this->getLinkRenderer()->makeLink(
+                               $this->target,
+                               null,
+                               [],
+                               $this->target->isRedirect() ? [ 'redirect' => 'no' ] : []
+                       );
 
-                               $msg = $this->msg( 'linkshere' )
-                                       ->params( $this->target->getPrefixedText() )
-                                       ->rawParams( $link )
-                                       ->parseAsBlock();
-                               $out->addHTML( $msg );
+                       $msg = $this->msg( 'linkshere' )
+                               ->params( $this->target->getPrefixedText() )
+                               ->rawParams( $link )
+                               ->parseAsBlock();
+                       $out->addHTML( $msg );
 
-                               $prevnext = $this->getPrevNext( $prevId, $nextId );
-                               $out->addHTML( $prevnext );
-                       }
+                       $prevnext = $this->getPrevNext( $prevId, $nextId );
+                       $out->addHTML( $prevnext );
                }
                $out->addHTML( $this->listStart( $level ) );
                foreach ( $rows as $row ) {
@@ -321,10 +317,8 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                $out->addHTML( $this->listEnd() );
 
-               if ( $level == 0 ) {
-                       if ( !$this->including() ) {
-                               $out->addHTML( $prevnext );
-                       }
+               if ( $level == 0 && !$this->including() ) {
+                       $out->addHTML( $prevnext );
                }
        }