+
+ $out->addHTML( Xml::openElement( 'div', array( 'class' => 'mw-spcontent' ) ) );
+
+ # Top header and navigation
+ if ( $this->shownavigation ) {
+ $out->addHTML( $this->getPageHeader() );
+ if ( $this->numRows > 0 ) {
+ $out->addHTML( '<p>' . wfShowingResults( $this->offset, $this->numRows ) . '</p>' );
+ # Disable the "next" link when we reach the end
+ $paging = wfViewPrevNext( $this->offset, $this->limit,
+ $this->getTitle( $par ),
+ wfArrayToCGI( $this->linkParameters() ), ( $this->numRows < $this->limit ) );
+ $out->addHTML( '<p>' . $paging . '</p>' );
+ } else {
+ # No results to show, so don't bother with "showing X of Y" etc.
+ # -- just let the user know and give up now
+ $out->addHTML( '<p>' . wfMsgHtml( 'specialpage-empty' ) . '</p>' );
+ $out->addHTML( Xml::closeElement( 'div' ) );
+ return;
+ }
+ }
+
+ # The actual results; specialist subclasses will want to handle this
+ # with more than a straight list, so we hand them the info, plus
+ # an OutputPage, and let them get on with it
+ $this->outputResults( $out,
+ $this->getSkin(),
+ $dbr, # Should use a ResultWrapper for this
+ $res,
+ $this->numRows,
+ $this->offset );
+
+ # Repeat the paging links at the bottom
+ if ( $this->shownavigation ) {
+ $out->addHTML( '<p>' . $paging . '</p>' );
+ }
+
+ $out->addHTML( Xml::closeElement( 'div' ) );
+
+ return $this->numRows;