11use MediaWiki\Cache\LinkBatchFactory;
14use MediaWiki\Languages\LanguageConverterFactory;
33 private LinkBatchFactory $linkBatchFactory;
37 LinkBatchFactory $linkBatchFactory,
39 LanguageConverterFactory $languageConverterFactory
41 parent::__construct(
'Unwatchedpages',
'unwatchedpages' );
42 $this->linkBatchFactory = $linkBatchFactory;
44 $this->languageConverter = $languageConverterFactory->getLanguageConverter( $this->
getContentLanguage() );
64 if ( !$res->numRows() ) {
68 $batch = $this->linkBatchFactory->newLinkBatch()->setCaller( __METHOD__ );
69 foreach ( $res as $row ) {
70 $batch->add( $row->namespace, $row->title );
81 'tables' => [
'page',
'watchlist' ],
83 'namespace' =>
'page_namespace',
84 'title' =>
'page_title',
85 'value' =>
'page_namespace'
89 'page_is_redirect' => 0,
92 'join_conds' => [
'watchlist' => [
93 'LEFT JOIN', [
'wl_title = page_title',
94 'wl_namespace = page_namespace' ] ] ]
105 return [
'page_namespace',
'page_title' ];
113 parent::execute( $par );
114 $this->
getOutput()->addModules(
'mediawiki.special.unwatchedPages' );
124 $nt = Title::makeTitleSafe( $result->namespace, $result->title );
126 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ],
127 Linker::getInvalidTitleDescription( $this->
getContext(), $result->namespace, $result->title ) );
130 $text = $this->languageConverter->convertHtml( $nt->getPrefixedText() );
134 $plink = $linkRenderer->makeKnownLink( $nt,
new HtmlArmor( $text ) );
135 $wlink = $linkRenderer->makeKnownLink(
137 $this->
msg(
'watch' )->text(),
138 [
'class' =>
'mw-watch-link' ],
139 [
'action' =>
'watch' ]
142 return $this->
getLanguage()->specialList( $plink, $wlink );
147 return 'maintenance';
155class_alias( SpecialUnwatchedPages::class,
'SpecialUnwatchedPages' );
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)
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.
getContentLanguage()
Shortcut to get content language.
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
List of pages that are not on anyone's watchlist.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
isExpensive()
Should this query page only be updated offline on large wikis?If the query for this page is considere...
sortDescending()
Override to sort by increasing values.to override bool
getOrderFields()
Subclasses return an array of fields to order by here.Don't append DESC to the field names,...
formatResult( $skin, $result)
preprocessResults( $db, $res)
Pre-cache page existence to speed up link generation.
__construct(LinkBatchFactory $linkBatchFactory, IConnectionProvider $dbProvider, LanguageConverterFactory $languageConverterFactory)
execute( $par)
Add the JS.
isSyndicated()
Sometimes we don't want to build rss / atom feeds.to override bool