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('categorylinks'),
28 'fields' => array('cl_to','count(*) AS count'),
29 'options' => array('GROUP BY' => 'cl_to')
33 function getIndexField() {
37 /* Override getBody to apply LinksBatch on resultset before actually outputting anything. */
39 if (!$this->mQueryDone
) {
42 $batch = new LinkBatch
;
44 $this->mResult
->rewind();
46 while ( $row = $this->mResult
->fetchObject() ) {
47 $batch->addObj( Title
::makeTitleSafe( NS_CATEGORY
, $row->cl_to
) );
50 $this->mResult
->rewind();
51 return parent
::getBody();
54 function formatRow($result) {
56 $title = Title
::makeTitle( NS_CATEGORY
, $result->cl_to
);
57 $titleText = $this->getSkin()->makeLinkObj( $title, htmlspecialchars( $title->getText() ) );
58 $count = wfMsgExt( 'nmembers', array( 'parsemag', 'escape' ),
59 $wgLang->formatNum( $result->count
) );
60 return Xml
::tags('li', null, "$titleText ($count)" ) . "\n";