MediaWiki REL1_30
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 public function getQueryInfo() {
41 return [
42 'tables' => [ 'page', 'categorylinks' ],
43 'fields' => [
44 'namespace' => 'page_namespace',
45 'title' => 'page_title',
46 'value' => 'page_title'
47 ],
48 'conds' => [
49 'cl_from IS NULL',
50 'page_namespace' => NS_CATEGORY,
51 'page_is_redirect' => 0
52 ],
53 'join_conds' => [ 'categorylinks' => [ 'LEFT JOIN', 'cl_to = page_title' ] ]
54 ];
55 }
56
61 function sortDescending() {
62 return false;
63 }
64
70 function formatResult( $skin, $result ) {
71 $title = Title::makeTitle( NS_CATEGORY, $result->title );
72
73 return $this->getLinkRenderer()->makeLink( $title, $title->getText() );
74 }
75
76 protected function getGroupName() {
77 return 'maintenance';
78 }
79
80 public function preprocessResults( $db, $res ) {
82 }
83}
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(ResultWrapper $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...
getPageHeader()
The content returned by this function will be output before any result.
$res
Definition database.txt:21
const NS_CATEGORY
Definition Defines.php:79