}
/**
- * Parameters and order changed in 1.18
+ * Somewhat deprecated, you probably want to be using execute()
*/
- function doQuery( $limit, $offset = false ) {
+ function doQuery( $offset = false, $limit = false ) {
if ( $this->isCached() && $this->isCacheable() ) {
return $this->fetchFromCache( $limit, $offset );
} else {
* real, honest-to-gosh query page.
*/
function execute( $par ) {
- global $wgUser, $wgOut, $wgLang;
+ global $wgUser, $wgOut, $wgLang, $wgRequest;
if ( !$this->userCanExecute( $wgUser ) ) {
$this->displayRestrictionError();
return;
}
- if ( $this->limit == 0 && $this->offset == 0 )
- list( $this->limit, $this->offset ) = wfCheckLimits();
+ if ( $this->limit == 0 && $this->offset == 0 ) {
+ list( $this->limit, $this->offset ) = $wgRequest->getLimitOffset();
+ }
$dbr = wfGetDB( DB_SLAVE );
$this->setHeaders();
if ( $num > 0 ) {
$html = array();
- if ( !$this->listoutput )
+ if ( !$this->listoutput ) {
$html[] = $this->openList( $offset );
+ }
# $res might contain the whole 1,000 rows, so we read up to
# $num [should update this to use a Pager]
}
}
- if ( !$this->listoutput )
+ if ( !$this->listoutput ) {
$html[] = $this->closeList();
+ }
$html = $this->listoutput
? $wgContLang->listToText( $html )
$this->feedUrl() );
$feed->outHeader();
- $dbr = wfGetDB( DB_SLAVE );
$res = $this->reallyDoQuery( $limit, 0 );
foreach ( $res as $obj ) {
$item = $this->feedResult( $obj );
function feedTitle() {
global $wgLanguageCode, $wgSitename;
- $page = SpecialPage::getPage( $this->getName() );
- $desc = $page->getDescription();
+ $desc = $this->getDescription();
return "$wgSitename - $desc [$wgLanguageCode]";
}
}
function feedUrl() {
- $title = SpecialPage::getTitleFor( $this->getName() );
- return $title->getFullURL();
+ return $this->getTitle()->getFullURL();
}
}