9be3d1c9d9823aea90eb128eb4516eabdce7fe22
[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 getPageHeader() {
29 return '<p>'.wfMsg('categoriespagetext')."</p><br>\n";
30 }
31 function getSQL() {
32 $NScat = NS_CATEGORY;
33 $dbr =& wfGetDB( DB_SLAVE );
34 $categorylinks = $dbr->tableName( 'categorylinks' );
35 return "SELECT DISTINCT 'Categories' as type,
36 {$NScat} as namespace,
37 cl_to as title,
38 1 as value
39 FROM $categorylinks";
40 }
41
42 function sortDescending() {
43 return false;
44 }
45
46 function formatResult( $skin, $result ) {
47 global $wgLang;
48 $title = Title::makeTitle( NS_CATEGORY, $result->title );
49 return $skin->makeLinkObj( $title, $title->getText() );
50 }
51 }
52
53 /**
54 *
55 */
56 function wfSpecialCategories() {
57 list( $limit, $offset ) = wfCheckLimits();
58
59 $cap = new CategoriesPage();
60
61 return $cap->doQuery( $offset, $limit );
62 }
63
64 ?>