X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWhatlinkshere.php;h=18c10bf706c2b20fb0dc6b5b0d5180b5d005e3b6;hp=b48e8587192792fd4731dc0e76fa036dd84f1940;hb=4cebf80a894f1bc9f9e2f732c8b78d5237810343;hpb=b8e0ca16aa743581f5fac5cef8bed5ac2bf6e7cb diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index b48e858719..18c10bf706 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -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 ); } }