Add some debugging notes to User::isValidUserName() rejections
[mediawiki.git] / includes / SpecialCategories.php
blobed2259d576888f47369822adf13155d4ba27aa71
1 <?php
2 /**
4 * @addtogroup SpecialPage
5 */
7 function wfSpecialCategories() {
8 global $wgOut;
10 $cap = new CategoryPager();
11 $wgOut->addHTML(
12 wfMsgExt( 'categoriespagetext', array( 'parse' ) ) .
13 $cap->getNavigationBar()
14 . '<ul>' . $cap->getBody() . '</ul>' .
15 $cap->getNavigationBar()
19 /**
20 * @addtogroup SpecialPage
21 * @addtogroup Pager
23 class CategoryPager extends AlphabeticPager {
24 function getQueryInfo() {
25 global $wgRequest;
26 return array(
27 'tables' => array('categorylinks'),
28 'fields' => array('cl_to','count(*) AS count'),
29 'options' => array('GROUP BY' => 'cl_to')
33 function getIndexField() {
34 return "cl_to";
37 /* Override getBody to apply LinksBatch on resultset before actually outputting anything. */
38 function getBody() {
39 if (!$this->mQueryDone) {
40 $this->doQuery();
42 $batch = new LinkBatch;
44 $this->mResult->rewind();
46 while ( $row = $this->mResult->fetchObject() ) {
47 $batch->addObj( Title::makeTitleSafe( NS_CATEGORY, $row->cl_to ) );
49 $batch->execute();
50 $this->mResult->rewind();
51 return parent::getBody();
54 function formatRow($result) {
55 global $wgLang;
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";