X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMostlinked.php;h=fbfaa73831f2dcc7994731e1cc74125a61bfc84d;hb=325e6a1b9d37d239b96caba45a1d18f826c11f8a;hp=36636471295b8d9e4ba6c9bd7c8817ab04dae117;hpb=2f885ee6b797e5a176ce7b270b674a04b5945b06;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php index 3663647129..fbfaa73831 100644 --- a/includes/specials/SpecialMostlinked.php +++ b/includes/specials/SpecialMostlinked.php @@ -25,6 +25,9 @@ * @author Rob Church */ +use Wikimedia\Rdbms\ResultWrapper; +use Wikimedia\Rdbms\IDatabase; + /** * A special page to show pages ordered by the number of pages linking to them. * @@ -78,16 +81,7 @@ class MostlinkedPage extends QueryPage { * @param ResultWrapper $res */ function preprocessResults( $db, $res ) { - if ( $res->numRows() > 0 ) { - $linkBatch = new LinkBatch(); - - foreach ( $res as $row ) { - $linkBatch->add( $row->namespace, $row->title ); - } - - $res->seek( 0 ); - $linkBatch->execute(); - } + $this->executeLBFromResultWrapper( $res ); } /** @@ -100,7 +94,8 @@ class MostlinkedPage extends QueryPage { function makeWlhLink( $title, $caption ) { $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() ); - return Linker::linkKnown( $wlh, $caption ); + $linkRenderer = $this->getLinkRenderer(); + return $linkRenderer->makeKnownLink( $wlh, $caption ); } /** @@ -124,10 +119,11 @@ class MostlinkedPage extends QueryPage { ); } - $link = Linker::link( $title ); + $linkRenderer = $this->getLinkRenderer(); + $link = $linkRenderer->makeLink( $title ); $wlh = $this->makeWlhLink( $title, - $this->msg( 'nlinks' )->numParams( $result->value )->escaped() + $this->msg( 'nlinks' )->numParams( $result->value )->text() ); return $this->getLanguage()->specialList( $link, $wlh );