42 private $currentCategoryCounts;
56 parent::__construct(
'Wantedcategories' );
64 'tables' => [
'categorylinks',
'page' ],
70 'conds' => [
'page_title' => null ],
71 'options' => [
'GROUP BY' =>
'cl_to' ],
72 'join_conds' => [
'page' => [
'LEFT JOIN',
73 [
'page_title = cl_to',
79 parent::preprocessResults( $db, $res );
81 $this->currentCategoryCounts = [];
83 if ( !$res->numRows() || !$this->isCached() ) {
91 foreach ( $res as $row ) {
92 $allCategories[] = $row->title;
95 $categoryRes = $db->newSelectQueryBuilder()
96 ->select( [
'cat_title',
'cat_pages' ] )
98 ->where( [
'cat_title' => $allCategories ] )
99 ->caller( __METHOD__ )->fetchResultSet();
100 foreach ( $categoryRes as $row ) {
101 $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages );
114 $nt = Title::makeTitle( $result->namespace, $result->title );
116 $text =
new HtmlArmor( $this->languageConverter->convertHtml( $nt->getText() ) );
124 $nlinks = $this->
msg(
'nmembers' )->numParams( $result->value )->escaped();
128 $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
129 $cachedValue = intval( $result->value );
132 if ( $nt->isKnown() || $currentValue === 0 ) {
133 $plink =
"<del>$plink</del>";
137 if ( $currentValue !== $cachedValue ) {
138 $nlinks = $this->
msg(
'nmemberschanged' )
139 ->numParams( $cachedValue, $currentValue )->escaped();
141 $nlinks = $this->
msg(
'nmembers' )->numParams( $cachedValue )->escaped();
145 return $this->
getLanguage()->specialList( $plink, $nlinks );
149 return 'maintenance';
157class_alias( SpecialWantedCategories::class,
'SpecialWantedCategories' );
Marks HTML that shouldn't be escaped.
setDatabaseProvider(IConnectionProvider $databaseProvider)
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getContentLanguage()
Shortcut to get content language.
getLanguage()
Shortcut to get user's language.
Base class for a "wanted" query page like WantedPages, WantedTemplates, etc.
The base class for all skins.