r104487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104486‎ | r104487 | r104488 >
Date:21:05, 28 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/AutoLoader.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialBlockList.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/AutoLoader.php
@@ -709,6 +709,7 @@
710710 'EmailInvalidation' => 'includes/specials/SpecialConfirmemail.php',
711711 'FewestrevisionsPage' => 'includes/specials/SpecialFewestrevisions.php',
712712 'FileDuplicateSearchPage' => 'includes/specials/SpecialFileDuplicateSearch.php',
 713+ 'HTMLBlockedUsersItemSelect' => 'includes/specials/SpecialBlockList.php',
713714 'ImportReporter' => 'includes/specials/SpecialImport.php',
714715 'IPBlockForm' => 'includes/specials/SpecialBlock.php',
715716 'LinkSearchPage' => 'includes/specials/SpecialLinkSearch.php',
Property changes on: branches/REL1_18/phase3/includes/AutoLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
716717 Merged /trunk/phase3/includes/AutoLoader.php:r104322,104350
717718 Merged /branches/wmf/1.18wmf1/includes/AutoLoader.php:r104486
Index: branches/REL1_18/phase3/includes/specials/SpecialBlockList.php
@@ -40,7 +40,7 @@
4141 * @param $par String title fragment
4242 */
4343 public function execute( $par ) {
44 - global $wgOut, $wgRequest;
 44+ global $wgOut, $wgRequest, $wgLang;
4545
4646 $this->setHeaders();
4747 $this->outputHeader();
@@ -78,6 +78,19 @@
7979 ),
8080 'flatlist' => true,
8181 ),
 82+ 'Limit' => array(
 83+ 'class' => 'HTMLBlockedUsersItemSelect',
 84+ 'label-message' => 'table_pager_limit_label',
 85+ 'options' => array(
 86+ $wgLang->formatNum( 20 ) => 20,
 87+ $wgLang->formatNum( 50 ) => 50,
 88+ $wgLang->formatNum( 100 ) => 100,
 89+ $wgLang->formatNum( 250 ) => 250,
 90+ $wgLang->formatNum( 500 ) => 500,
 91+ ),
 92+ 'name' => 'limit',
 93+ 'default' => 50,
 94+ ),
8295 );
8396 $form = new HTMLForm( $fields, $this->getContext() );
8497 $form->setMethod( 'get' );
@@ -393,3 +406,32 @@
394407 return $this->page->getTitle();
395408 }
396409 }
 410+
 411+/**
 412+ * Items per page dropdown. Essentially a crap workaround for bug 32603.
 413+ *
 414+ * @todo Do not release 1.19 with this.
 415+ */
 416+class HTMLBlockedUsersItemSelect extends HTMLSelectField {
 417+ /**
 418+ * Basically don't do any validation. If it's a number that's fine. Also,
 419+ * add it to the list if it's not there already
 420+ *
 421+ * @param $value
 422+ * @param $alldata
 423+ * @return bool
 424+ */
 425+ function validate( $value, $alldata ) {
 426+ if ( $value == '' ) {
 427+ return true;
 428+ }
 429+
 430+ if ( !in_array( $value, $this->mParams['options'] ) ) {
 431+ $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value);
 432+ asort( $this->mParams['options'] );
 433+ }
 434+
 435+ return true;
 436+ }
 437+
 438+}
Property changes on: branches/REL1_18/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
397439 Merged /branches/wmf/1.18wmf1/includes/specials:r104486
398440 Merged /trunk/phase3/includes/specials:r104318,104322,104350
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
399441 Merged /branches/wmf/1.18wmf1/includes:r104486
400442 Merged /trunk/phase3/includes:r104318,104322,104350
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
401443 Merged /branches/wmf/1.18wmf1:r104486
402444 Merged /trunk/phase3:r104318,104322,104350

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104318Bug 32603 - limit option is missing on Special:BlockList...johnduhart22:15, 26 November 2011
r104322Followup r104318, add the new class to the Autoloaderjohnduhart23:05, 26 November 2011
r104350Followup r104318, sort the options in the limit dropdownjohnduhart17:31, 27 November 2011
r104486MFT r104318, r104322, r104350reedy21:03, 28 November 2011

Status & tagging log