hook point for injecting fields into edit form
[mediawiki.git] / includes / SpecialUnusedcategories.php
blob5cd3406bb40cdf706b5a4602ec8fe7cdb302c429
1 <?php
2 /**
4 * @addtogroup SpecialPage
5 */
7 /**
9 * @addtogroup SpecialPage
11 class UnusedCategoriesPage extends QueryPage {
13 function getName() {
14 return 'Unusedcategories';
17 function getPageHeader() {
18 return '<p>' . wfMsg('unusedcategoriestext') . '</p>';
21 function getSQL() {
22 $NScat = NS_CATEGORY;
23 $dbr = wfGetDB( DB_SLAVE );
24 list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
25 return "SELECT 'Unusedcategories' as type,
26 {$NScat} as namespace, page_title as title, page_title as value
27 FROM $page
28 LEFT JOIN $categorylinks ON page_title=cl_to
29 WHERE cl_from IS NULL
30 AND page_namespace = {$NScat}
31 AND page_is_redirect = 0";
34 function formatResult( $skin, $result ) {
35 $title = Title::makeTitle( NS_CATEGORY, $result->title );
36 return $skin->makeLinkObj( $title, $title->getText() );
40 /** constructor */
41 function wfSpecialUnusedCategories() {
42 list( $limit, $offset ) = wfCheckLimits();
43 $uc = new UnusedCategoriesPage();
44 return $uc->doQuery( $offset, $limit );