wfProfileOut( $fname );
}
+
+ /**
+ * Return the result wrapper.
+ */
+ function getResult() {
+ return $this->mResult;
+ }
+
+ /**
+ * Set the offset from an other source than $wgRequest
+ */
+ function setOffset( $offset ) {
+ $this->mOffset = $offset;
+ }
+ /**
+ * Set the limit from an other source than $wgRequest
+ */
+ function setLimit( $limit ) {
+ $this->mLimit = $limit;
+ }
/**
* Extract some useful data from the result object for use by
if ( $query === null ) {
return $text;
}
- if( $type == 'prev' || $type == 'next' ) {
- $attrs = "rel=\"$type\"";
- } elseif( $type == 'first' ) {
- $attrs = "rel=\"start\"";
- } else {
- # HTML 4 has no rel="end" . . .
- $attrs = '';
+
+ $attrs = array();
+ if( in_array( $type, array( 'first', 'prev', 'next', 'last' ) ) ) {
+ # HTML5 rel attributes
+ $attrs['rel'] = $type;
}
if( $type ) {
- $attrs .= " class=\"mw-{$type}link\"" ;
+ $attrs['class'] = "mw-{$type}link";
}
- return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), $text,
- wfArrayToCGI( $query, $this->getDefaultQuery() ), '', '',
- $attrs );
+ return $this->getSkin()->link( $this->getTitle(), $text,
+ $attrs, $query + $this->getDefaultQuery(), array('noclasses','known') );
}
/**
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
- $limits = implode( ' | ', $limitLinks );
+ $limits = $wgLang->pipeList( $limitLinks );
$this->mNavigationBar =
- "({$pagingLinks['first']} | {$pagingLinks['last']}) " .
+ "(" . $wgLang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
wfMsgHtml( 'viewprevnext', $pagingLinks['prev'],
$pagingLinks['next'], $limits );
if( $first ) {
$first = false;
} else {
- $extra .= ' | ';
+ $extra .= wfMsgExt( 'pipe-separator' , 'escapenoentities' );
}
if( $order == $this->mOrderType ) {
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
- $limits = implode( ' | ', $limitLinks );
+ $limits = $wgLang->pipeList( $limitLinks );
- $this->mNavigationBar = "({$pagingLinks['first']} | {$pagingLinks['last']}) " .
+ $this->mNavigationBar = "({$pagingLinks['first']}" . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . "{$pagingLinks['last']}) " .
wfMsgHtml("viewprevnext", $pagingLinks['prev'], $pagingLinks['next'], $limits);
return $this->mNavigationBar;
}
}
function formatRow( $row ) {
- $s = "<tr>\n";
+ $rowClass = $this->getRowClass( $row );
+ $s = "<tr class=\"$rowClass\">\n";
$fieldNames = $this->getFieldNames();
$this->mCurrentRow = $row; # In case formatValue needs to know
foreach ( $fieldNames as $field => $name ) {
return $s;
}
+ function getRowClass($row) {
+ return '';
+ }
+
function getIndexField() {
return $this->mSort;
}
"<form method=\"get\" action=\"$url\">" .
wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) .
"\n<input type=\"submit\" value=\"$msgSubmit\"/>\n" .
- $this->getHiddenFields( 'limit' ) .
+ $this->getHiddenFields( array('limit','title') ) .
"</form>\n";
}