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