48 parent::__construct(
'Unusedtemplates' );
50 $this->linksMigration = $linksMigration;
70 $queryInfo = $this->linksMigration->getQueryInfo(
75 [ $ns, $title ] = $this->linksMigration->getTitleFields(
'templatelinks' );
77 $templatelinksJoin = [
78 'LEFT JOIN', [
"$title = page_title",
79 "$ns = page_namespace" ] ];
80 if ( in_array(
'linktarget', $queryInfo[
'tables'] ) ) {
81 $joinConds[
'linktarget'] = $templatelinksJoin;
83 $joinConds[
'templatelinks'] = $templatelinksJoin;
85 $joinConds[
'page_props'] = [
'LEFT JOIN', [
'page_id = pp_page',
'pp_propname' =>
'expectunusedtemplate' ] ];
87 'tables' => array_merge( $queryInfo[
'tables'], [
'page' ], [
'page_props' ] ),
89 'namespace' =>
'page_namespace',
90 'title' =>
'page_title',
95 'page_is_redirect' => 0,
98 'join_conds' => array_merge( $joinConds, $queryInfo[
'joins'] )
113 $title = Title::makeTitle(
NS_TEMPLATE, $result->title );
114 $pageLink = $linkRenderer->makeKnownLink( $title );
115 $wlhLink = $linkRenderer->makeKnownLink(
117 $this->msg(
'unusedtemplateswlh' )->text()
120 return $this->
getLanguage()->specialList( $pageLink, $wlhLink );
124 return $this->
msg(
'unusedtemplatestext' )->parseAsBlock();
128 return 'maintenance';
136class_alias( SpecialUnusedTemplates::class,
'SpecialUnusedTemplates' );
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...
Parent class for all special pages.
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,...
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.