summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialCategories.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialCategories.php')
-rw-r--r--includes/specials/SpecialCategories.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/includes/specials/SpecialCategories.php b/includes/specials/SpecialCategories.php
index c6e73f2b..a649eafd 100644
--- a/includes/specials/SpecialCategories.php
+++ b/includes/specials/SpecialCategories.php
@@ -13,9 +13,10 @@ function wfSpecialCategories( $par=null ) {
$from = $par;
}
$cap = new CategoryPager( $from );
+ $cap->doQuery();
$wgOut->addHTML(
XML::openElement( 'div', array('class' => 'mw-spcontent') ) .
- wfMsgExt( 'categoriespagetext', array( 'parse' ) ) .
+ wfMsgExt( 'categoriespagetext', array( 'parse' ), $cap->getNumRows() ) .
$cap->getStartForm( $from ) .
$cap->getNavigationBar() .
'<ul>' . $cap->getBody() . '</ul>' .
@@ -35,10 +36,7 @@ class CategoryPager extends AlphabeticPager {
parent::__construct();
$from = str_replace( ' ', '_', $from );
if( $from !== '' ) {
- global $wgCapitalLinks, $wgContLang;
- if( $wgCapitalLinks ) {
- $from = $wgContLang->ucfirst( $from );
- }
+ $from = Title::capitalize( $from, NS_CATEGORY );
$this->mOffset = $from;
}
}
@@ -74,9 +72,6 @@ class CategoryPager extends AlphabeticPager {
/* Override getBody to apply LinksBatch on resultset before actually outputting anything. */
public function getBody() {
- if (!$this->mQueryDone) {
- $this->doQuery();
- }
$batch = new LinkBatch;
$this->mResult->rewind();
@@ -92,7 +87,7 @@ class CategoryPager extends AlphabeticPager {
function formatRow($result) {
global $wgLang;
$title = Title::makeTitle( NS_CATEGORY, $result->cat_title );
- $titleText = $this->getSkin()->makeLinkObj( $title, htmlspecialchars( $title->getText() ) );
+ $titleText = $this->getSkin()->link( $title, htmlspecialchars( $title->getText() ) );
$count = wfMsgExt( 'nmembers', array( 'parsemag', 'escape' ),
$wgLang->formatNum( $result->cat_pages ) );
return Xml::tags('li', null, "$titleText ($count)" ) . "\n";