51 parent::__construct(
'Wantedcategories' );
59 'tables' => [
'categorylinks',
'page' ],
65 'conds' => [
'page_title IS NULL' ],
66 'options' => [
'GROUP BY' =>
'cl_to' ],
67 'join_conds' => [
'page' => [
'LEFT JOIN',
68 [
'page_title = cl_to',
74 parent::preprocessResults( $db,
$res );
76 $this->currentCategoryCounts = [];
78 if ( !
$res->numRows() || !$this->isCached() ) {
86 foreach (
$res as $row ) {
87 $allCategories[] = $row->title;
90 $categoryRes = $db->select(
92 [
'cat_title',
'cat_pages' ],
93 [
'cat_title' => $allCategories ],
96 foreach ( $categoryRes as $row ) {
97 $this->currentCategoryCounts[$row->cat_title] = intval( $row->cat_pages );
110 $nt = Title::makeTitle( $result->namespace, $result->title );
112 $text =
new HtmlArmor( $this->languageConverter->convertHtml( $nt->getText() ) );
120 $nlinks = $this->
msg(
'nmembers' )->numParams( $result->value )->escaped();
124 $currentValue = $this->currentCategoryCounts[$result->title] ?? 0;
125 $cachedValue = intval( $result->value );
128 if ( $nt->isKnown() || $currentValue === 0 ) {
129 $plink =
"<del>$plink</del>";
133 if ( $currentValue !== $cachedValue ) {
134 $nlinks = $this->
msg(
'nmemberschanged' )
135 ->numParams( $cachedValue, $currentValue )->escaped();
137 $nlinks = $this->
msg(
'nmembers' )->numParams( $cachedValue )->escaped();
141 return $this->
getLanguage()->specialList( $plink, $nlinks );
145 return 'maintenance';
Marks HTML that shouldn't be escaped.
setDBLoadBalancer(ILoadBalancer $loadBalancer)
LinkBatchFactory null $linkBatchFactory
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
ILoadBalancer null $loadBalancer
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.
getContentLanguage()
Shortcut to get content language.
A querypage to list the most wanted categories - implements Special:Wantedcategories.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
preprocessResults( $db, $res)
Cache page existence for performance.
ILanguageConverter $languageConverter
__construct(ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory, LanguageConverterFactory $languageConverterFactory)
formatResult( $skin, $result)
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Class definition for a wanted query page like WantedPages, WantedTemplates, etc.
The shared interface for all language converters.