r64978 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64977‎ | r64978 | r64979 >
Date:20:50, 12 April 2010
Author:siebrand
Status:ok
Tags:
Comment:
* (bug 23102) Parse wiki text for Special:CentralAuth radio button texts
* update indentation a bit and remove trailing whitespace
Modified paths:
  • /trunk/extensions/CentralAuth/SpecialCentralAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 class SpecialCentralAuth extends SpecialPage {
54 var $mUserName, $mCanUnmerge, $mCanLock, $mCanOversight, $mCanEdit;
65 var $mGlobalUser, $mAttachedLocalAccounts, $mUnattachedLocalAccounts;
@@ -82,7 +81,7 @@
8382 $this->showWikiLists();
8483 }
8584 }
86 -
 85+
8786 /** Returns true if the normal form should be displayed */
8887 function doSubmit() {
8988 $deleted = false;
@@ -142,7 +141,7 @@
143142 } elseif( $reasonDetail ) {
144143 $reason .= wfMsgForContent( 'colon-separator' ) . $reasonDetail;
145144 }
146 -
 145+
147146 if ( $oldHiddenLevel != $setHidden ) {
148147 $hideStatus = $globalUser->adminSetHidden( $setHidden );
149148 switch( $setHidden ) {
@@ -168,11 +167,11 @@
169168 elseif( $oldHiddenLevel == CentralAuthUser::HIDDEN_OVERSIGHT )
170169 $globalUser->unsuppress( $reason );
171170 }
172 -
 171+
173172 $good =
174173 ( is_null($lockStatus) || $lockStatus->isGood() ) &&
175174 ( is_null($hideStatus) || $hideStatus->isGood() );
176 -
 175+
177176 // Logging etc
178177 if ( $good && (count($added) || count($removed)) ) {
179178 $added = count($added) ?
@@ -399,7 +398,7 @@
400399 $expiryd = $wgLang->date( $row['block-expiry'] );
401400 $expiryt = $wgLang->time( $row['block-expiry'] );
402401 $reason = $row['block-reason'];
403 -
 402+
404403 $text = wfMsgExt( 'centralauth-admin-blocked', 'parseinline', array( $expiry, $reason, $expiryd, $expiryt ) );
405404 }
406405 } else {
@@ -473,7 +472,7 @@
474473 'User:' . $this->mUserName,
475474 $wikiname,
476475 wfMsg( 'centralauth-foreign-link', $this->mUserName, $wikiname ) );
477 -
 476+
478477 }
479478
480479 function adminCheck( $wikiID ) {
@@ -499,7 +498,7 @@
500499 ) .
501500 '</form></fieldset>' );
502501 }
503 -
 502+
504503 function showStatusForm() {
505504 // Allows locking, hiding, locking and hiding.
506505 global $wgUser, $wgOut;
@@ -508,49 +507,53 @@
509508 $form .= Xml::hidden( 'wpMethod', 'set-status' );
510509 $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken() );
511510 $form .= wfMsgExt( 'centralauth-admin-status-intro', 'parse' );
512 -
 511+
513512 // Radio buttons
514513 $radioLocked =
515514 Xml::radioLabel(
516 - wfMsg( 'centralauth-admin-status-locked-no' ),
 515+ wfMsgExt( 'centralauth-admin-status-locked-no', array( 'parseinline' ) ),
517516 'wpStatusLocked',
518517 '0',
519518 'mw-centralauth-status-locked-no',
520519 !$this->mGlobalUser->isLocked() ) .
521520 '<br />' .
522521 Xml::radioLabel(
523 - wfMsg( 'centralauth-admin-status-locked-yes' ),
 522+ wfMsgExt( 'centralauth-admin-status-locked-yes', array( 'parseinline' ) ),
524523 'wpStatusLocked',
525524 '1',
526525 'mw-centralauth-status-locked-yes',
527526 $this->mGlobalUser->isLocked() );
528527 $radioHidden =
529528 Xml::radioLabel(
530 - wfMsg( 'centralauth-admin-status-hidden-no' ),
 529+ wfMsgExt( 'centralauth-admin-status-hidden-no', array( 'parseinline' ) ),
531530 'wpStatusHidden',
532531 CentralAuthUser::HIDDEN_NONE,
533532 'mw-centralauth-status-hidden-no',
534533 $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_NONE ) .
535534 '<br />' .
536535 Xml::radioLabel(
537 - wfMsg( 'centralauth-admin-status-hidden-list' ),
 536+ wfMsgExt( 'centralauth-admin-status-hidden-list', array( 'parseinline' ) ),
538537 'wpStatusHidden',
539538 CentralAuthUser::HIDDEN_LISTS,
540539 'mw-centralauth-status-hidden-list',
541540 $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_LISTS ) .
542541 '<br />';
543 - if( $this->mCanOversight )
 542+ if( $this->mCanOversight ) {
544543 $radioHidden .= Xml::radioLabel(
545 - wfMsg( 'centralauth-admin-status-hidden-oversight' ),
 544+ wfMsgExt( 'centralauth-admin-status-hidden-oversight', array( 'parseinline' ) ),
546545 'wpStatusHidden',
547546 CentralAuthUser::HIDDEN_OVERSIGHT,
548547 'mw-centralauth-status-hidden-oversight',
549 - $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_OVERSIGHT );
 548+ $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_OVERSIGHT
 549+ );
 550+ }
550551
551552 // Reason
552 - $reasonList = Xml::listDropDown( 'wpReasonList',
 553+ $reasonList = Xml::listDropDown(
 554+ 'wpReasonList',
553555 wfMsgForContent( 'centralauth-admin-status-reasons' ),
554 - wfMsgForContent( 'ipbreasonotherlist' ) );
 556+ wfMsgForContent( 'ipbreasonotherlist' )
 557+ );
555558 $reasonField = Xml::input( 'wpReason', 45, false );
556559
557560 $form .= Xml::buildForm(
@@ -559,18 +562,20 @@
560563 'centralauth-admin-status-hidden' => $radioHidden,
561564 'centralauth-admin-reason' => $reasonList,
562565 'centralauth-admin-reason-other' => $reasonField ),
563 - 'centralauth-admin-status-submit' );
 566+ 'centralauth-admin-status-submit'
 567+ );
564568
565569 $form .= '</fieldset>';
566 - $form = Xml::tags( 'form',
567 - array( 'method' => 'POST',
568 - 'action' =>
569 - $this->getTitle()->getFullURL(
570 - array( 'target' => $this->mUserName )
571 - ),
572 - ),
573 - $form
574 - );
 570+ $form = Xml::tags(
 571+ 'form',
 572+ array(
 573+ 'method' => 'POST',
 574+ 'action' => $this->getTitle()->getFullURL(
 575+ array( 'target' => $this->mUserName )
 576+ ),
 577+ ),
 578+ $form
 579+ );
575580 $wgOut->addHTML( $form );
576581 }
577582
@@ -622,7 +627,7 @@
623628
624629 function logAction( $action, $target, $reason = '', $params = array(), $suppressLog = false ) {
625630 $logType = $suppressLog ? 'suppress' : 'globalauth'; // Not centralauth because of some weird length limitiations
626 - $log = new LogPage( $logType );
 631+ $log = new LogPage( $logType );
627632 $log->addEntry( $action, Title::newFromText( "User:{$target}@global" ), $reason, $params );
628633 }
629634 }

Status & tagging log