4 * @addtogroup SpecialPage
7 function wfSpecialCategories() {
10 $cap = new CategoryPager();
12 wfMsgWikiHtml( 'categoriespagetext' ) .
13 $cap->getNavigationBar()
14 . '<ul>' . $cap->getBody() . '</ul>' .
15 $cap->getNavigationBar()
20 * @addtogroup SpecialPage
23 class CategoryPager
extends AlphabeticPager
{
24 function getQueryInfo() {
26 'tables' => array('categorylinks'),
27 'fields' => array('cl_to','count(*) AS count'),
28 'options' => array('GROUP BY' => 'cl_to')
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->cl_to
) );
49 $this->mResult
->rewind();
50 return parent
::getBody();
53 function formatRow($result) {
55 $title = Title
::makeTitle( NS_CATEGORY
, $result->cl_to
);
56 $titleText = $this->getSkin()->makeLinkObj( $title, htmlspecialchars( $title->getText() ) );
57 $count = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
58 $wgLang->formatNum( $result->count
) );
59 return Xml
::tags('li', null, "$titleText ($count)" ) . "\n";