*
* Subclassing the pager to implement concrete functionality should be fairly
* simple, please see the examples in HistoryPage.php and
- * SpecialIpblocklist.php. You just need to override formatRow(),
+ * SpecialBlockList.php. You just need to override formatRow(),
* getQueryInfo() and getIndexField(). Don't forget to call the parent
* constructor if you override it.
*
}
/**
- * Return the result wrapper.
+ * @return ResultWrapper The result wrapper.
*/
function getResult() {
return $this->mResult;
$tableClass = htmlspecialchars( $this->getTableClass() );
$sortClass = htmlspecialchars( $this->getSortHeaderClass() );
- $s = "<table border='1' class=\"$tableClass\"><thead><tr>\n";
+ $s = "<table style='border:1;' class=\"$tableClass\"><thead><tr>\n";
$fields = $this->getFieldNames();
# Make table header
* @return Associative array
*/
function getRowAttrs( $row ) {
- return array( 'class' => $this->getRowClass( $row ) );
+ $class = $this->getRowClass( $row );
+ if ( $class === '' ) {
+ // Return an empty array to avoid clutter in HTML like class=""
+ return array();
+ } else {
+ return array( 'class' => $this->getRowClass( $row ) );
+ }
}
/**
function getNavigationBar() {
global $wgStylePath, $wgContLang;
- if ( !$this->isNavigationBarShown() ) return '';
+ if ( !$this->isNavigationBarShown() ) {
+ return '';
+ }
$path = "$wgStylePath/common/images";
$labels = array(
$links = $this->getPagingLinks( $linkTexts, $disabledTexts );
$navClass = htmlspecialchars( $this->getNavClass() );
- $s = "<table class=\"$navClass\" align=\"center\" cellpadding=\"3\"><tr>\n";
- $cellAttrs = 'valign="top" align="center" width="' . 100 / count( $links ) . '%"';
+ $s = "<table class=\"$navClass\"><tr>\n";
+ $width = 100 / count( $links ) . '%';
foreach ( $labels as $type => $label ) {
- $s .= "<td $cellAttrs>{$links[$type]}</td>\n";
+ $s .= "<td style='width:$width;'>{$links[$type]}</td>\n";
}
$s .= "</tr></table>\n";
return $s;
function getLimitForm() {
global $wgScript;
+ return Xml::openElement(
+ 'form',
+ array(
+ 'method' => 'get',
+ 'action' => $wgScript
+ ) ) . "\n" . $this->getLimitDropdown() . "</form>\n";
+ }
+
+ /**
+ * Gets a limit selection dropdown
+ *
+ * @return string
+ */
+ function getLimitDropdown() {
# Make the select with some explanatory text
$msgSubmit = wfMsgHtml( 'table_pager_limit_submit' );
- return
- Xml::openElement(
- 'form',
- array(
- 'method' => 'get',
- 'action' => $wgScript
- )
- ) . "\n" .
- wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) .
+
+ return wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) .
"\n<input type=\"submit\" value=\"$msgSubmit\"/>\n" .
- $this->getHiddenFields( array( 'limit' ) ) .
- "</form>\n";
+ $this->getHiddenFields( array( 'limit' ) );
}
/**