Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -387,6 +387,8 @@ |
388 | 388 | 'youremail', |
389 | 389 | 'username', |
390 | 390 | 'uid', |
| 391 | + 'prefs-memberingroups', |
| 392 | + 'prefs-changemembership', |
391 | 393 | 'yourrealname', |
392 | 394 | 'yourlanguage', |
393 | 395 | 'yourvariant', |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -603,10 +603,45 @@ |
604 | 604 | $this->tableRow( Xml::element( 'h2', null, wfMsg( 'prefs-personal' ) ) ) |
605 | 605 | ); |
606 | 606 | |
| 607 | + # Get groups to which the user belongs |
| 608 | + $userEffectiveGroups = $wgUser->getEffectiveGroups(); |
| 609 | + $userEffectiveGroupsArray = array(); |
| 610 | + foreach( $userEffectiveGroups as $ueg ) { |
| 611 | + if( $ueg == '*' ) { |
| 612 | + // Skip the default * group, seems useless here |
| 613 | + continue; |
| 614 | + } |
| 615 | + $msgName = 'group-' . $ueg; |
| 616 | + $groupName = wfMsg( $msgName ); |
| 617 | + if( wfEmptyMsg( $msgName, $groupName ) ) { |
| 618 | + // No localized groupname available |
| 619 | + $groupName = $ueg; |
| 620 | + } |
| 621 | + $userEffectiveGroupsArray[] = $groupName; |
| 622 | + } |
| 623 | + asort( $userEffectiveGroupsArray ); |
| 624 | + |
| 625 | + $sk = $wgUser->getSkin(); |
| 626 | + $toolLinks = array(); |
| 627 | + $toolLinks[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'ListGroupRights' ), wfMsg( 'listgrouprights' ) ); |
| 628 | + if( $wgUser->isAllowed( 'userrights' ) ) { |
| 629 | + $toolLinks[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userrights' ), |
| 630 | + wfMsg( 'prefs-changemembership' ), |
| 631 | + 'user=' . htmlspecialchars( $wgUser->getName() ) |
| 632 | + ); |
| 633 | + } |
| 634 | + |
607 | 635 | $userInformationHtml = |
608 | 636 | $this->tableRow( wfMsgHtml( 'username' ), htmlspecialchars( $wgUser->getName() ) ) . |
609 | 637 | $this->tableRow( wfMsgHtml( 'uid' ), htmlspecialchars( $wgUser->getId() ) ) . |
| 638 | + |
610 | 639 | $this->tableRow( |
| 640 | + wfMsgExt( 'prefs-memberingroups', array( 'parseinline' ), count( $userEffectiveGroupsArray ) ), |
| 641 | + implode( wfMsg( 'comma-separator' ), $userEffectiveGroupsArray ) . |
| 642 | + '<br />(' . implode( ' | ', $toolLinks ) . ')' |
| 643 | + ) . |
| 644 | + |
| 645 | + $this->tableRow( |
611 | 646 | wfMsgHtml( 'prefs-edits' ), |
612 | 647 | $wgLang->formatNum( User::edits( $wgUser->getId() ) ) |
613 | 648 | ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -872,6 +872,8 @@ |
873 | 873 | 'youremail' => 'E-mail:', |
874 | 874 | 'username' => 'Username:', |
875 | 875 | 'uid' => 'User ID:', |
| 876 | +'prefs-memberingroups' => 'Member of {{PLURAL:$1|group|groups}}:', |
| 877 | +'prefs-changemembership' => 'Change group membership', |
876 | 878 | 'yourrealname' => 'Real name:', |
877 | 879 | 'yourlanguage' => 'Language:', |
878 | 880 | 'yourvariant' => 'Variant:', # only translate this message to other languages if you have to change it |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -557,6 +557,8 @@ |
558 | 558 | 'youremail' => 'E-Mail-Adresse:', |
559 | 559 | 'username' => 'Benutzername:', |
560 | 560 | 'uid' => 'Benutzer-ID:', |
| 561 | +'prefs-memberingroups' => 'Mitglied der {{PLURAL:$1|Benutzergruppe|Benutzergruppen}}:', |
| 562 | +'prefs-changemembership' => 'Benutzerrechte ändern', |
561 | 563 | 'yourrealname' => 'Echter Name:', |
562 | 564 | 'yourlanguage' => 'Sprache der Benutzeroberfläche:', |
563 | 565 | 'yourvariant' => 'Variante', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -129,6 +129,7 @@ |
130 | 130 | * Sidebar is now cached for all languages |
131 | 131 | * (bug 14259) Localisation message for upload button on Special:Import is now |
132 | 132 | 'import-upload' instead of 'upload' |
| 133 | +* Add information about user group membership to Special:Preferences |
133 | 134 | |
134 | 135 | === Bug fixes in 1.13 === |
135 | 136 | |