7namespace MediaWiki\Specials;
9use MediaWiki\Deferred\LinksUpdate\TemplateLinksTable;
10use MediaWiki\Html\Html;
11use MediaWiki\Linker\Linker;
12use MediaWiki\Linker\LinksMigration;
13use MediaWiki\Page\LinkBatchFactory;
14use MediaWiki\Skin\Skin;
15use MediaWiki\SpecialPage\QueryPage;
16use MediaWiki\SpecialPage\SpecialPage;
17use MediaWiki\Title\Title;
19use Wikimedia\Rdbms\IConnectionProvider;
20use Wikimedia\Rdbms\IReadableDatabase;
21use Wikimedia\Rdbms\IResultWrapper;
37 parent::__construct(
'Mostlinkedtemplates' );
71 $queryInfo = $this->linksMigration->getQueryInfo(
'templatelinks' );
72 [ $ns, $title ] = $this->linksMigration->getTitleFields(
'templatelinks' );
74 'tables' => $queryInfo[
'tables'],
80 'options' => [
'GROUP BY' => [ $ns, $title ] ],
81 'join_conds' => $queryInfo[
'joins']
103 $title = Title::makeTitleSafe( $result->namespace, $result->title );
107 [
'class' =>
'mw-invalidtitle' ],
108 Linker::getInvalidTitleDescription(
118 $this->makeWlhLink( $title, $result )
129 private function makeWlhLink( $title, $result ) {
131 $label = $this->
msg(
'ntransclusions' )->numParams( $result->value )->text();
138 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
139 parent::execute( $par );
150 TemplateLinksTable::VIRTUAL_DOMAIN,
161class_alias( SpecialMostLinkedTemplates::class,
'SpecialMostLinkedTemplates' );
Factory for LinkBatch objects to batch query page metadata.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
setDatabaseProvider(IConnectionProvider $databaseProvider)
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getLanguage()
Shortcut to get user's language.