* Show the special page
*/
public function execute( $par ) {
- global $wgOut, $wgGroupPermissions, $wgImplicitGroups, $wgMessageCache;
+ global $wgOut, $wgImplicitGroups, $wgMessageCache;
+ global $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups;
$wgMessageCache->loadAllMessages();
$this->setHeaders();
$grouplink = '';
}
+ $addgroups = isset( $wgAddGroups[$group] ) ? $wgAddGroups[$group] : array();
+ $removegroups = isset( $wgRemoveGroups[$group] ) ? $wgRemoveGroups[$group] : array();
+
$wgOut->addHTML(
'<tr>
<td>' .
$grouppage . $grouplink .
'</td>
<td>' .
- self::formatPermissions( $permissions ) .
+ self::formatPermissions( $permissions, $addgroups, $removegroups ) .
'</td>
</tr>'
);
* @param $permissions Array of permission => bool (from $wgGroupPermissions items)
* @return string List of all granted permissions, separated by comma separator
*/
- private static function formatPermissions( $permissions ) {
+ private static function formatPermissions( $permissions, $add, $remove ) {
+ global $wgLang;
$r = array();
foreach( $permissions as $permission => $granted ) {
if ( $granted ) {
}
}
sort( $r );
+ if( $add ) {
+ $r[] = wfMsgHTML( 'listgrouprights-addgroup', $wgLang->listToText( $add ) );
+ }
+ if( $remove ) {
+ $r[] = wfMsgHTML( 'listgrouprights-removegroup', $wgLang->listToText( $remove ) );
+ }
if( empty( $r ) ) {
return '';
} else {
'listgrouprights-helppage' => 'Help:Group rights',
'listgrouprights-members' => '(list of members)',
'listgrouprights-right-display' => '$1 ($2)', # only translate this message to other languages if you have to change it
+'listgrouprights-addgroup' => 'Can add groups: $1',
+'listgrouprights-removegroup' => 'Can remove groups: $1',
# E-mail user
'mailnologin' => 'No send address',