$_REQUEST -> $wgRequest
[mediawiki.git] / includes / SpecialCategories.php
blob4e0656016b97f373b60cbe129b3fb350933bede7
1 <?php
3 require_once("QueryPage.php");
5 class CategoriesPage extends QueryPage {
7 function getName() {
8 return "Categories";
11 function isExpensive() {
12 return false;
15 function getSQL() {
16 $NScat = NS_CATEGORY;
17 $dbr =& wfGetDB( DB_SLAVE );
18 $categorylinks = $dbr->tableName( 'categorylinks' );
19 return "SELECT DISTINCT 'Categories' as type,
20 {$NScat} as namespace,
21 cl_to as title,
22 1 as value
23 FROM $categorylinks";
26 function sortDescending() {
27 return false;
30 function formatResult( $skin, $result ) {
31 global $wgLang;
32 $title = Title::makeTitle( NS_CATEGORY, $result->title );
33 return $skin->makeLinkObj( $title, $title->getText() );
37 function wfSpecialCategories()
39 list( $limit, $offset ) = wfCheckLimits();
41 $cap = new CategoriesPage();
43 return $cap->doQuery( $offset, $limit );