Index: trunk/phase3/includes/specials/SpecialBlockList.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | $this->setHeaders(); |
45 | 45 | $this->outputHeader(); |
46 | 46 | $out = $this->getOutput(); |
| 47 | + $lang = $this->getLanguage(); |
47 | 48 | $out->setPageTitle( $this->msg( 'ipblocklist' ) ); |
48 | 49 | $out->addModuleStyles( 'mediawiki.special' ); |
49 | 50 | |
— | — | @@ -80,6 +81,19 @@ |
81 | 82 | ), |
82 | 83 | 'flatlist' => true, |
83 | 84 | ), |
| 85 | + 'Limit' => array( |
| 86 | + 'class' => 'HTMLBlockedUsersItemSelect', |
| 87 | + 'label-message' => 'table_pager_limit_label', |
| 88 | + 'options' => array( |
| 89 | + $lang->formatNum( 20 ) => 20, |
| 90 | + $lang->formatNum( 50 ) => 50, |
| 91 | + $lang->formatNum( 100 ) => 100, |
| 92 | + $lang->formatNum( 250 ) => 250, |
| 93 | + $lang->formatNum( 500 ) => 500, |
| 94 | + ), |
| 95 | + 'name' => 'limit', |
| 96 | + 'default' => 50, |
| 97 | + ), |
84 | 98 | ); |
85 | 99 | $form = new HTMLForm( $fields, $this->getContext() ); |
86 | 100 | $form->setMethod( 'get' ); |
— | — | @@ -434,3 +448,31 @@ |
435 | 449 | wfProfileOut( __METHOD__ ); |
436 | 450 | } |
437 | 451 | } |
| 452 | + |
| 453 | +/** |
| 454 | + * Items per page dropdown. Essentially a crap workaround for bug 32603. |
| 455 | + * |
| 456 | + * @todo Do not release 1.19 with this. |
| 457 | + */ |
| 458 | +class HTMLBlockedUsersItemSelect extends HTMLSelectField { |
| 459 | + /** |
| 460 | + * Basically don't do any validation. If it's a number that's fine. Also, |
| 461 | + * add it to the list if it's not there already |
| 462 | + * |
| 463 | + * @param $value |
| 464 | + * @param $alldata |
| 465 | + * @return bool |
| 466 | + */ |
| 467 | + function validate( $value, $alldata ) { |
| 468 | + if ( $value == '' ) { |
| 469 | + return true; |
| 470 | + } |
| 471 | + |
| 472 | + if ( !in_array( $value, $this->mParams['options'] ) ) { |
| 473 | + $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value); |
| 474 | + } |
| 475 | + |
| 476 | + return true; |
| 477 | + } |
| 478 | + |
| 479 | +} |
\ No newline at end of file |