Index: trunk/phase3/includes/Pager.php |
— | — | @@ -986,7 +986,14 @@ |
987 | 987 | */ |
988 | 988 | function getLimitSelect() { |
989 | 989 | global $wgLang; |
990 | | - $s = "<select name=\"limit\">"; |
| 990 | + |
| 991 | + # Add the current limit from the query string |
| 992 | + # to avoid that the limit is lost after clicking Go next time |
| 993 | + if ( !in_array( $this->mLimit, $this->mLimitsShown ) ) { |
| 994 | + $this->mLimitsShown[] = $this->mLimit; |
| 995 | + sort( $this->mLimitsShown ); |
| 996 | + } |
| 997 | + $s = Html::openElement( 'select', array( 'name' => 'limit' ) ) . "\n"; |
991 | 998 | foreach ( $this->mLimitsShown as $key => $value ) { |
992 | 999 | # The pair is either $index => $limit, in which case the $value |
993 | 1000 | # will be numeric, or $limit => $text, in which case the $value |
— | — | @@ -998,10 +1005,9 @@ |
999 | 1006 | $limit = $key; |
1000 | 1007 | $text = $value; |
1001 | 1008 | } |
1002 | | - $selected = ( $limit == $this->mLimit ? 'selected="selected"' : '' ); |
1003 | | - $s .= "<option value=\"$limit\" $selected>$text</option>\n"; |
| 1009 | + $s .= Xml::option( $text, $limit, $limit == $this->mLimit ) . "\n"; |
1004 | 1010 | } |
1005 | | - $s .= "</select>"; |
| 1011 | + $s .= Html::closeElement( 'select' ); |
1006 | 1012 | return $s; |
1007 | 1013 | } |
1008 | 1014 | |