X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPager.php;h=9028f0e06b734752f614d5c31c7af0ca9f720ee9;hb=1c36af4fb08c8557cbb2f6488e2cce56d360cd8a;hp=2d8be2328b735ed0dfb97772ccb7e998ad11263e;hpb=c2db3369164e9656899548d230d87bcaf2832121;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Pager.php b/includes/Pager.php index 2d8be2328b..9028f0e06b 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -51,7 +51,7 @@ interface Pager { * * 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. * @@ -164,7 +164,7 @@ abstract class IndexPager implements Pager { } /** - * Return the result wrapper. + * @return ResultWrapper The result wrapper. */ function getResult() { return $this->mResult; @@ -815,7 +815,7 @@ abstract class TablePager extends IndexPager { $tableClass = htmlspecialchars( $this->getTableClass() ); $sortClass = htmlspecialchars( $this->getSortHeaderClass() ); - $s = "\n"; + $s = "
\n"; $fields = $this->getFieldNames(); # Make table header @@ -899,7 +899,13 @@ abstract class TablePager extends IndexPager { * @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 ) ); + } } /** @@ -937,7 +943,9 @@ abstract class TablePager extends IndexPager { function getNavigationBar() { global $wgStylePath, $wgContLang; - if ( !$this->isNavigationBarShown() ) return ''; + if ( !$this->isNavigationBarShown() ) { + return ''; + } $path = "$wgStylePath/common/images"; $labels = array( @@ -974,10 +982,10 @@ abstract class TablePager extends IndexPager { $links = $this->getPagingLinks( $linkTexts, $disabledTexts ); $navClass = htmlspecialchars( $this->getNavClass() ); - $s = "
\n"; - $cellAttrs = 'valign="top" align="center" width="' . 100 / count( $links ) . '%"'; + $s = "
\n"; + $width = 100 / count( $links ) . '%'; foreach ( $labels as $type => $label ) { - $s .= "\n"; + $s .= "\n"; } $s .= "
{$links[$type]}{$links[$type]}
\n"; return $s; @@ -1045,20 +1053,26 @@ abstract class TablePager extends IndexPager { function getLimitForm() { global $wgScript; + return Xml::openElement( + 'form', + array( + 'method' => 'get', + 'action' => $wgScript + ) ) . "\n" . $this->getLimitDropdown() . "\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\n" . - $this->getHiddenFields( array( 'limit' ) ) . - "\n"; + $this->getHiddenFields( array( 'limit' ) ); } /**