Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -693,10 +693,9 @@ |
694 | 694 | 'userrights-groupsavailable', |
695 | 695 | 'userrights-groupshelp', |
696 | 696 | 'userrights-reason', |
697 | | - 'userrights-list', |
698 | | - 'userrights-list-nogroups', |
699 | | - 'userrights-list-groups', |
700 | | - 'userrights-list-separator', |
| 697 | + 'userrights-available-none', |
| 698 | + 'userrights-available-add', |
| 699 | + 'userrights-available-remove', |
701 | 700 | ), |
702 | 701 | 'group' => array( |
703 | 702 | 'group', |
Index: trunk/phase3/includes/SpecialUserrights.php |
— | — | @@ -229,12 +229,26 @@ |
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
233 | | - * Explains what groups the user can add and remove, and why. |
| 233 | + * Prepare a list of groups the user is able to add and remove |
234 | 234 | * |
235 | | - * @return string Explanatory sanitized HTML message |
| 235 | + * @return string |
236 | 236 | */ |
237 | 237 | private function explainRights() { |
238 | | - global $wgUser; |
| 238 | + global $wgUser, $wgLang; |
| 239 | + |
| 240 | + $out = array(); |
| 241 | + list( $add, $remove ) = array_values( $this->changeableGroups() ); |
| 242 | + |
| 243 | + if( count( $add ) > 0 ) |
| 244 | + $out[] = wfMsgExt( 'userrights-available-add', 'parseinline', $wgLang->listToText( $add ) ); |
| 245 | + if( count( $remove ) > 0 ) |
| 246 | + $out[] = wfMsgExt( 'userrights-available-remove', 'parseinline', $wgLang->listToText( $remove ) ); |
| 247 | + |
| 248 | + return count( $out ) > 0 |
| 249 | + ? implode( ' ', $out ) |
| 250 | + : wfMsgExt( 'userrights-available-none', 'parseinline' ); |
| 251 | + |
| 252 | + |
239 | 253 | $groups = $wgUser->getEffectiveGroups(); |
240 | 254 | foreach( $groups as $group ) { |
241 | 255 | if( $this->changeableByGroup( $group ) == array( |
— | — | @@ -248,6 +262,8 @@ |
249 | 263 | $grouplists = array( $groups ); |
250 | 264 | list( $grouplists[1], $grouplists[2] ) = array_values( $this->changeableGroups() ); |
251 | 265 | |
| 266 | + |
| 267 | + |
252 | 268 | // Now format them nicely for display (yay mutable variables? I'm sick |
253 | 269 | // of thinking up new names) |
254 | 270 | foreach( $grouplists as &$list ) { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1273,10 +1273,9 @@ |
1274 | 1274 | 'userrights-groupshelp' => 'Select groups you want the user to be removed from or added to. |
1275 | 1275 | Unselected groups will not be changed. You can deselect a group with CTRL + Left Click', |
1276 | 1276 | 'userrights-reason' => 'Reason for change:', |
1277 | | -'userrights-list' => 'Because you are a member of $1, you can add $2 and remove $3.', |
1278 | | -'userrights-list-nogroups' => 'no groups', |
1279 | | -'userrights-list-groups' => 'the {{PLURAL:$1|group|groups}} $2', |
1280 | | -'userrights-list-separator' => ', ', # only translate this message to other languages if you have to change it |
| 1277 | +'userrights-available-none' => 'You may not alter group membership.', |
| 1278 | +'userrights-available-add' => 'You can add users to $1.', |
| 1279 | +'userrights-available-remove' => 'You can remove users from $1.', |
1281 | 1280 | |
1282 | 1281 | # Groups |
1283 | 1282 | 'group' => 'Group:', |