MediaWiki REL1_31
SpecialUnusedcategories.php
Go to the documentation of this file.
1<?php
28 function __construct( $name = 'Unusedcategories' ) {
29 parent::__construct( $name );
30 }
31
32 public function isExpensive() {
33 return true;
34 }
35
36 function getPageHeader() {
37 return $this->msg( 'unusedcategoriestext' )->parseAsBlock();
38 }
39
40 function getOrderFields() {
41 return [ 'title' ];
42 }
43
44 public function getQueryInfo() {
45 return [
46 'tables' => [ 'page', 'categorylinks' ],
47 'fields' => [
48 'namespace' => 'page_namespace',
49 'title' => 'page_title',
50 ],
51 'conds' => [
52 'cl_from IS NULL',
53 'page_namespace' => NS_CATEGORY,
54 'page_is_redirect' => 0
55 ],
56 'join_conds' => [ 'categorylinks' => [ 'LEFT JOIN', 'cl_to = page_title' ] ]
57 ];
58 }
59
64 function sortDescending() {
65 return false;
66 }
67
73 function formatResult( $skin, $result ) {
74 $title = Title::makeTitle( NS_CATEGORY, $result->title );
75
76 return $this->getLinkRenderer()->makeLink( $title, $title->getText() );
77 }
78
79 protected function getGroupName() {
80 return 'maintenance';
81 }
82
83 public function preprocessResults( $db, $res ) {
85 }
86}
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
Definition QueryPage.php:34
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed ResultWrapper (MUST include title and ...
msg( $key)
Wrapper around wfMessage that sets the current context.
sortDescending()
A should come before Z (T32907)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
preprocessResults( $db, $res)
Do any necessary preprocessing of the result object.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
__construct( $name='Unusedcategories')
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
getOrderFields()
Subclasses return an array of fields to order by here.
getPageHeader()
The content returned by this function will be output before any result.
$res
Definition database.txt:21
const NS_CATEGORY
Definition Defines.php:88