4 * @addtogroup SpecialPage
7 function wfSpecialCategories() {
10 $cap = new CategoryPager();
12 wfMsgWikiHtml( 'categoriespagetext' ) .
13 $cap->getNavigationBar()
14 . '<ul>' . $cap->getBody() . '</ul>' .
15 $cap->getNavigationBar()
19 class CategoryPager
extends AlphabeticPager
{
20 function getQueryInfo() {
22 'tables' => array('categorylinks'),
23 'fields' => array('cl_to','count(*) AS count'),
24 'options' => array('GROUP BY' => 'cl_to')
28 function getIndexField() {
32 /* Override getBody to apply LinksBatch on resultset before actually outputting anything. */
34 if (!$this->mQueryDone
) {
37 $batch = new LinkBatch
;
39 $this->mResult
->rewind();
41 while ( $row = $this->mResult
->fetchObject() ) {
42 $batch->addObj( Title
::makeTitleSafe( NS_CATEGORY
, $row->cl_to
) );
45 $this->mResult
->rewind();
46 return parent
::getBody();
49 function formatRow($result) {
51 $title = Title
::makeTitle( NS_CATEGORY
, $result->cl_to
);
54 $this->getSkin()->makeLinkObj( $title, $title->getText() )
56 wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
57 $wgLang->formatNum( $result->count
) )