From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/specials/SpecialCategories.php | 68 +++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 20 deletions(-) (limited to 'includes/specials/SpecialCategories.php') diff --git a/includes/specials/SpecialCategories.php b/includes/specials/SpecialCategories.php index eb49fdbc..c2dd40cd 100644 --- a/includes/specials/SpecialCategories.php +++ b/includes/specials/SpecialCategories.php @@ -1,29 +1,57 @@ setHeaders(); + $this->outputHeader(); + $wgOut->allowClickjacking(); - if( $par == '' ) { - $from = $wgRequest->getText( 'from' ); - } else { - $from = $par; + $from = $wgRequest->getText( 'from', $par ); + + $cap = new CategoryPager( $from ); + $cap->doQuery(); + + $wgOut->addHTML( + Html::openElement( 'div', array( 'class' => 'mw-spcontent' ) ) . + wfMsgExt( 'categoriespagetext', array( 'parse' ), $cap->getNumRows() ) . + $cap->getStartForm( $from ) . + $cap->getNavigationBar() . + '' . + $cap->getNavigationBar() . + Html::closeElement( 'div' ) + ); } - $wgOut->allowClickjacking(); - $cap = new CategoryPager( $from ); - $cap->doQuery(); - $wgOut->addHTML( - XML::openElement( 'div', array('class' => 'mw-spcontent') ) . - wfMsgExt( 'categoriespagetext', array( 'parse' ), $cap->getNumRows() ) . - $cap->getStartForm( $from ) . - $cap->getNavigationBar() . - '' . - $cap->getNavigationBar() . - XML::closeElement( 'div' ) - ); } /** @@ -77,7 +105,7 @@ class CategoryPager extends AlphabeticPager { $this->mResult->rewind(); - while ( $row = $this->mResult->fetchObject() ) { + foreach ( $this->mResult as $row ) { $batch->addObj( Title::makeTitleSafe( NS_CATEGORY, $row->cat_title ) ); } $batch->execute(); @@ -100,7 +128,7 @@ class CategoryPager extends AlphabeticPager { return Xml::tags( 'form', array( 'method' => 'get', 'action' => $wgScript ), - Xml::hidden( 'title', $t->getPrefixedText() ) . + Html::hidden( 'title', $t->getPrefixedText() ) . Xml::fieldset( wfMsg( 'categories' ), Xml::inputLabel( wfMsg( 'categoriesfrom' ), 'from', 'from', 20, $from ) . -- cgit v1.2.2