I had a fix for this bug sitting in my working copy for over a week without getting...
[lhc/web/wiklou.git] / includes / SpecialCategories.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
7
8 /**
9 *
10 */
11 require_once("QueryPage.php");
12
13 /**
14 *
15 * @package MediaWiki
16 * @subpackage SpecialPage
17 */
18 class CategoriesPage extends QueryPage {
19
20 function getName() {
21 return "Categories";
22 }
23
24 function isExpensive() {
25 return false;
26 }
27
28 function getSQL() {
29 $NScat = NS_CATEGORY;
30 $dbr =& wfGetDB( DB_SLAVE );
31 $categorylinks = $dbr->tableName( 'categorylinks' );
32 return "SELECT DISTINCT 'Categories' as type,
33 {$NScat} as namespace,
34 cl_to as title,
35 1 as value
36 FROM $categorylinks";
37 }
38
39 function sortDescending() {
40 return false;
41 }
42
43 function formatResult( $skin, $result ) {
44 global $wgLang;
45 $title = Title::makeTitle( NS_CATEGORY, $result->title );
46 return $skin->makeLinkObj( $title, $title->getText() );
47 }
48 }
49
50 /**
51 *
52 */
53 function wfSpecialCategories() {
54 list( $limit, $offset ) = wfCheckLimits();
55
56 $cap = new CategoriesPage();
57
58 return $cap->doQuery( $offset, $limit );
59 }
60
61 ?>