r104486 MediaWiki - Code Review archive

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

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/AutoLoader.php
@@ -710,6 +710,7 @@
711711 'EmailInvalidation' => 'includes/specials/SpecialConfirmemail.php',
712712 'FewestrevisionsPage' => 'includes/specials/SpecialFewestrevisions.php',
713713 'FileDuplicateSearchPage' => 'includes/specials/SpecialFileDuplicateSearch.php',
 714+ 'HTMLBlockedUsersItemSelect' => 'includes/specials/SpecialBlockList.php',
714715 'ImportReporter' => 'includes/specials/SpecialImport.php',
715716 'IPBlockForm' => 'includes/specials/SpecialBlock.php',
716717 'LinkSearchPage' => 'includes/specials/SpecialLinkSearch.php',
Property changes on: branches/wmf/1.18wmf1/includes/AutoLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
717718 Merged /trunk/phase3/includes/AutoLoader.php:r104322,104350
Index: branches/wmf/1.18wmf1/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' );
@@ -394,3 +407,32 @@
395408 return $this->page->getTitle();
396409 }
397410 }
 411+
 412+/**
 413+ * Items per page dropdown. Essentially a crap workaround for bug 32603.
 414+ *
 415+ * @todo Do not release 1.19 with this.
 416+ */
 417+class HTMLBlockedUsersItemSelect extends HTMLSelectField {
 418+ /**
 419+ * Basically don't do any validation. If it's a number that's fine. Also,
 420+ * add it to the list if it's not there already
 421+ *
 422+ * @param $value
 423+ * @param $alldata
 424+ * @return bool
 425+ */
 426+ function validate( $value, $alldata ) {
 427+ if ( $value == '' ) {
 428+ return true;
 429+ }
 430+
 431+ if ( !in_array( $value, $this->mParams['options'] ) ) {
 432+ $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value);
 433+ asort( $this->mParams['options'] );
 434+ }
 435+
 436+ return true;
 437+ }
 438+
 439+}
Property changes on: branches/wmf/1.18wmf1/includes/specials/SpecialBlockList.php
___________________________________________________________________
Modified: svn:mergeinfo
398440 Merged /trunk/phase3/includes/specials/SpecialBlockList.php:r104318,104322,104350
Property changes on: branches/wmf/1.18wmf1/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
399441 Merged /trunk/phase3/includes/specials:r104318,104322,104350
Property changes on: branches/wmf/1.18wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
400442 Merged /trunk/phase3/includes:r104318,104322,104350
Property changes on: branches/wmf/1.18wmf1
___________________________________________________________________
Modified: svn:mergeinfo
401443 Merged /trunk/phase3:r104318,104322,104350

Follow-up revisions

RevisionCommit summaryAuthorDate
r104487MFT r104486, Merges r104318, r104322, r104350reedy21:05, 28 November 2011

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

Status & tagging log