*
* @return String
*/
- function getBody() {
+ public function getBody() {
if ( !$this->mQueryDone ) {
$this->doQuery();
}
+
+ if ( $this->mResult->numRows() ) {
+ # Do any special query batches before display
+ $this->doBatchLookups();
+ }
+
# Don't use any extra rows returned by the query
$numRows = min( $this->mResult->numRows(), $this->mLimit );
);
}
+ /**
+ * Called from getBody(), before getStartBody() is called and
+ * after doQuery() was called. This will be called only if there
+ * are rows in the result set.
+ *
+ * @return void
+ */
+ protected function doBatchLookups() {}
+
/**
* Hook into getBody(), allows text to be inserted at the start. This
* will be called even if there are no rows in the result set.
*
* @return String
*/
- function getStartBody() {
+ protected function getStartBody() {
return '';
}
*
* @return String
*/
- function getEndBody() {
+ protected function getEndBody() {
return '';
}
*
* @return String
*/
- function getEmptyBody() {
+ protected function getEmptyBody() {
return '';
}
}
foreach ( $this->mLimitsShown as $limit ) {
$links[] = $this->makeLink(
- $this->getLang()->formatNum( $limit ),
+ $this->getLanguage()->formatNum( $limit ),
array( 'offset' => $offset, 'limit' => $limit ),
'num'
);
return $this->mNavigationBar;
}
- $lang = $this->getLang();
+ $lang = $this->getLanguage();
$opts = array( 'parsemag', 'escapenoentities' );
$linkTexts = array(
return $this->mNavigationBar;
}
- $nicenumber = $this->getLang()->formatNum( $this->mLimit );
+ $nicenumber = $this->getLanguage()->formatNum( $this->mLimit );
$linkTexts = array(
'prev' => wfMsgExt(
'pager-newer-n',
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
- $limits = $this->getLang()->pipeList( $limitLinks );
+ $limits = $this->getLanguage()->pipeList( $limitLinks );
$this->mNavigationBar = "({$pagingLinks['first']}" .
wfMsgExt( 'pipe-separator' , 'escapenoentities' ) .
'next' => 'arrow_disabled_right_25.png',
'last' => 'arrow_disabled_last_25.png',
);
- if( $this->getLang()->isRTL() ) {
+ if( $this->getLanguage()->isRTL() ) {
$keys = array_keys( $labels );
$images = array_combine( $keys, array_reverse( $images ) );
$disabledImages = array_combine( $keys, array_reverse( $disabledImages ) );
# will be a string.
if( is_int( $value ) ){
$limit = $value;
- $text = $this->getLang()->formatNum( $limit );
+ $text = $this->getLanguage()->formatNum( $limit );
} else {
$limit = $key;
$text = $value;