4 * @addtogroup SpecialPage
7 function wfSpecialCategories() {
10 $cap = new CategoryPager();
12 wfMsgExt( 'categoriespagetext', array( 'parse' ) ) .
13 $cap->getNavigationBar()
14 . '<ul>' . $cap->getBody() . '</ul>' .
15 $cap->getNavigationBar()
20 * @addtogroup SpecialPage
23 class CategoryPager
extends AlphabeticPager
{
24 function getQueryInfo() {
27 'tables' => array('category'),
28 'fields' => array('cat_title','cat_pages')
32 function getIndexField() {
36 /* Override getBody to apply LinksBatch on resultset before actually outputting anything. */
38 if (!$this->mQueryDone
) {
41 $batch = new LinkBatch
;
43 $this->mResult
->rewind();
45 while ( $row = $this->mResult
->fetchObject() ) {
46 $batch->addObj( Title
::makeTitleSafe( NS_CATEGORY
, $row->cat_title
) );
49 $this->mResult
->rewind();
50 return parent
::getBody();
53 function formatRow($result) {
55 $title = Title
::makeTitle( NS_CATEGORY
, $result->cat_title
);
56 $titleText = $this->getSkin()->makeLinkObj( $title, htmlspecialchars( $title->getText() ) );
57 $count = wfMsgExt( 'nmembers', array( 'parsemag', 'escape' ),
58 $wgLang->formatNum( $result->cat_pages
) );
59 return Xml
::tags('li', null, "$titleText ($count)" ) . "\n";