r66234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66233‎ | r66234 | r66235 >
Date:22:54, 11 May 2010
Author:siebrand
Status:ok
Tags:
Comment:
* support GENDER in 'siteuser'
* update formatting here and there
Modified paths:
  • /trunk/phase3/includes/Credits.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Credits.php
@@ -119,14 +119,18 @@
120120 $cnt--;
121121 if ( $user->isLoggedIn() ) {
122122 $link = self::link( $user );
123 - if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
 123+ if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) {
124124 $real_names[] = $link;
125 - else
 125+ } else {
126126 $user_names[] = $link;
 127+ }
127128 } else {
128129 $anon_ips[] = self::link( $user );
129130 }
130 - if ( $cnt == 0 ) break;
 131+
 132+ if ( $cnt == 0 ) {
 133+ break;
 134+ }
131135 }
132136
133137 if ( count( $real_names ) ) {
@@ -137,15 +141,21 @@
138142
139143 # "ThisSite user(s) A, B and C"
140144 if ( count( $user_names ) ) {
141 - $user = wfMsgExt( 'siteusers', array( 'parsemag' ),
142 - $wgLang->listToText( $user_names ), count( $user_names ) );
 145+ $user = wfMsgExt(
 146+ 'siteusers',
 147+ 'parsemag',
 148+ $wgLang->listToText( $user_names ), count( $user_names )
 149+ );
143150 } else {
144151 $user = false;
145152 }
146153
147154 if ( count( $anon_ips ) ) {
148 - $anon = wfMsgExt( 'anonusers', array( 'parsemag' ),
149 - $wgLang->listToText( $anon_ips ), count( $anon_ips ) );
 155+ $anon = wfMsgExt(
 156+ 'anonusers',
 157+ 'parsemag',
 158+ $wgLang->listToText( $anon_ips ), count( $anon_ips )
 159+ );
150160 } else {
151161 $anon = false;
152162 }
@@ -174,10 +184,11 @@
175185 */
176186 protected static function link( User $user ) {
177187 global $wgUser, $wgHiddenPrefs;
178 - if ( !in_array( 'realname', $wgHiddenPrefs ) && !$user->isAnon() )
 188+ if ( !in_array( 'realname', $wgHiddenPrefs ) && !$user->isAnon() ) {
179189 $real = $user->getRealName();
180 - else
 190+ } else {
181191 $real = false;
 192+ }
182193
183194 $skin = $wgUser->getSkin();
184195 $page = $user->isAnon() ?
@@ -198,10 +209,11 @@
199210 return wfMsgExt( 'anonuser', array( 'parseinline', 'replaceafter' ), $link );
200211 } else {
201212 global $wgHiddenPrefs;
202 - if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
 213+ if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) {
203214 return $link;
204 - else
205 - return wfMsgExt( 'siteuser', array( 'parseinline', 'replaceafter' ), $link );
 215+ } else {
 216+ return wfMsgExt( 'siteuser', 'parsemag', $link, $user->getName() );
 217+ }
206218 }
207219 }
208220

Follow-up revisions

RevisionCommit summaryAuthorDate
r66237Follow-up r66234: support GENDER in 'siteuser'siebrand23:21, 11 May 2010
r66330Update check blacklist per r66234ialex08:55, 13 May 2010

Status & tagging log