Use Doxygen @addtogroup instead of phpdoc @package && @subpackage
[lhc/web/wiklou.git] / includes / SpecialCategories.php
1 <?php
2 /**
3 *
4 * @addtogroup SpecialPage
5 */
6
7 /**
8 *
9 * @addtogroup SpecialPage
10 */
11 class CategoriesPage extends QueryPage {
12
13 function getName() {
14 return "Categories";
15 }
16
17 function isExpensive() {
18 return false;
19 }
20
21 function isSyndicated() { return false; }
22
23 function getPageHeader() {
24 return wfMsgWikiHtml( 'categoriespagetext' );
25 }
26
27 function getSQL() {
28 $NScat = NS_CATEGORY;
29 $dbr =& wfGetDB( DB_SLAVE );
30 $categorylinks = $dbr->tableName( 'categorylinks' );
31 $implicit_groupby = $dbr->implicitGroupby() ? '1' : 'cl_to';
32 $s= "SELECT 'Categories' as type,
33 {$NScat} as namespace,
34 cl_to as title,
35 $implicit_groupby as value,
36 COUNT(*) as count
37 FROM $categorylinks
38 GROUP BY 1,2,3,4";
39 return $s;
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 $plink = $skin->makeLinkObj( $title, $title->getText() );
50 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
51 $wgLang->formatNum( $result->count ) );
52 return wfSpecialList($plink, $nlinks);
53 }
54 }
55
56 /**
57 *
58 */
59 function wfSpecialCategories() {
60 list( $limit, $offset ) = wfCheckLimits();
61
62 $cap = new CategoriesPage();
63
64 return $cap->doQuery( $offset, $limit );
65 }
66
67 ?>